Skip to content

Commit 2b28a58

Browse files
author
Gogs
committed
Fixes for running database migration with mysql2
1 parent b9fc90d commit 2b28a58

10 files changed

Lines changed: 67 additions & 73 deletions

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
55
gem 'rails', '5.2.3'
66
# Use sqlite3 as the database for Active Record
77
gem 'sqlite3'
8-
gem 'mysql2', '~> 0.3.18'
8+
gem 'mysql2', '~> 0.4.4'
99
# Use SCSS for stylesheets
1010
gem 'sass-rails', '~> 5.0'
1111
# Use Uglifier as compressor for JavaScript assets

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ GEM
113113
mini_mime (1.0.2)
114114
mini_portile2 (2.4.0)
115115
minitest (5.11.3)
116-
mysql2 (0.3.21)
116+
mysql2 (0.4.10)
117117
nio4r (2.4.0)
118118
nokogiri (1.10.3)
119119
mini_portile2 (~> 2.4.0)
@@ -201,7 +201,7 @@ DEPENDENCIES
201201
jbuilder (~> 2.0)
202202
jquery-rails
203203
jwt
204-
mysql2 (~> 0.3.18)
204+
mysql2 (~> 0.4.4)
205205
rails (= 5.2.3)
206206
sass-rails (~> 5.0)
207207
sdoc (~> 0.4.0)

db/migrate/20190525164329_create_states.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateStates < ActiveRecord::Migration
1+
class CreateStates < ActiveRecord::Migration[4.2]
22
def change
33
create_table :states do |t|
44
t.string :name

db/migrate/20190525164336_create_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateUsers < ActiveRecord::Migration
1+
class CreateUsers < ActiveRecord::Migration[4.2]
22
def change
33
create_table :users do |t|
44
t.string :name

db/migrate/20190525164530_create_folders.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateFolders < ActiveRecord::Migration
1+
class CreateFolders < ActiveRecord::Migration[4.2]
22
def change
33
create_table :folders do |t|
44
t.string :name

db/migrate/20190528071549_create_tags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateTags < ActiveRecord::Migration
1+
class CreateTags < ActiveRecord::Migration[4.2]
22
def change
33
create_table :tags do |t|
44
t.string :name

db/migrate/20190528071703_create_people.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreatePeople < ActiveRecord::Migration
1+
class CreatePeople < ActiveRecord::Migration[4.2]
22
def change
33
create_table :people do |t|
44
t.string :name

db/migrate/20190528071704_create_documents.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateDocuments < ActiveRecord::Migration
1+
class CreateDocuments < ActiveRecord::Migration[4.2]
22
def change
33
create_table :documents do |t|
44
t.string :title

db/migrate/20190528071907_create_documenttags.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateDocumenttags < ActiveRecord::Migration
1+
class CreateDocumenttags < ActiveRecord::Migration[4.2]
22
def change
33
create_table :documenttags do |t|
44
t.references :document, index: true, foreign_key: true

db/schema.rb

Lines changed: 57 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: UTF-8
21
# This file is auto-generated from the current state of the database. Instead
32
# of editing this file, please use the migrations feature of Active Record to
43
# incrementally modify your database, and then regenerate this schema definition.
@@ -11,83 +10,78 @@
1110
#
1211
# It's strongly recommended that you check this file into your version control system.
1312

14-
ActiveRecord::Schema.define(version: 20190528071907) do
13+
ActiveRecord::Schema.define(version: 2019_05_28_071907) do
1514

16-
create_table "documents", force: :cascade do |t|
17-
t.string "title", limit: 255
18-
t.text "description", limit: 65535
19-
t.date "document_date"
20-
t.string "document_url", limit: 255
21-
t.decimal "version", precision: 10
22-
t.integer "folder_id", limit: 4
23-
t.integer "user_id", limit: 4
24-
t.integer "state_id", limit: 4
25-
t.integer "person_id", limit: 4
26-
t.datetime "created_at", null: false
27-
t.datetime "updated_at", null: false
15+
create_table "documents", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
16+
t.string "title"
17+
t.text "description"
18+
t.date "document_date"
19+
t.string "document_url"
20+
t.decimal "version", precision: 10
21+
t.integer "folder_id"
22+
t.integer "user_id"
23+
t.integer "state_id"
24+
t.integer "person_id"
25+
t.datetime "created_at", null: false
26+
t.datetime "updated_at", null: false
27+
t.index ["folder_id"], name: "index_documents_on_folder_id"
28+
t.index ["person_id"], name: "index_documents_on_person_id"
29+
t.index ["state_id"], name: "index_documents_on_state_id"
30+
t.index ["user_id"], name: "index_documents_on_user_id"
2831
end
2932

30-
add_index "documents", ["folder_id"], name: "index_documents_on_folder_id", using: :btree
31-
add_index "documents", ["person_id"], name: "index_documents_on_person_id", using: :btree
32-
add_index "documents", ["state_id"], name: "index_documents_on_state_id", using: :btree
33-
add_index "documents", ["user_id"], name: "index_documents_on_user_id", using: :btree
34-
35-
create_table "documenttags", force: :cascade do |t|
36-
t.integer "document_id", limit: 4
37-
t.integer "tag_id", limit: 4
38-
t.datetime "created_at", null: false
39-
t.datetime "updated_at", null: false
33+
create_table "documenttags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
34+
t.integer "document_id"
35+
t.integer "tag_id"
36+
t.datetime "created_at", null: false
37+
t.datetime "updated_at", null: false
38+
t.index ["document_id"], name: "index_documenttags_on_document_id"
39+
t.index ["tag_id"], name: "index_documenttags_on_tag_id"
4040
end
4141

42-
add_index "documenttags", ["document_id"], name: "index_documenttags_on_document_id", using: :btree
43-
add_index "documenttags", ["tag_id"], name: "index_documenttags_on_tag_id", using: :btree
44-
45-
create_table "folders", force: :cascade do |t|
46-
t.string "name", limit: 255
47-
t.integer "folder_id", limit: 4
48-
t.integer "user_id", limit: 4
49-
t.datetime "created_at", null: false
50-
t.datetime "updated_at", null: false
42+
create_table "folders", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
43+
t.string "name"
44+
t.integer "folder_id"
45+
t.integer "user_id"
46+
t.datetime "created_at", null: false
47+
t.datetime "updated_at", null: false
48+
t.index ["folder_id"], name: "index_folders_on_folder_id"
49+
t.index ["name"], name: "index_folders_on_name", unique: true
50+
t.index ["user_id"], name: "index_folders_on_user_id"
5151
end
5252

53-
add_index "folders", ["folder_id"], name: "index_folders_on_folder_id", using: :btree
54-
add_index "folders", ["name"], name: "index_folders_on_name", unique: true, using: :btree
55-
add_index "folders", ["user_id"], name: "index_folders_on_user_id", using: :btree
56-
57-
create_table "people", force: :cascade do |t|
58-
t.string "name", limit: 255
59-
t.integer "user_id", limit: 4
60-
t.datetime "created_at", null: false
61-
t.datetime "updated_at", null: false
53+
create_table "people", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
54+
t.string "name"
55+
t.integer "user_id"
56+
t.datetime "created_at", null: false
57+
t.datetime "updated_at", null: false
6258
end
6359

64-
create_table "states", force: :cascade do |t|
65-
t.string "name", limit: 255
66-
t.integer "user_id", limit: 4
67-
t.datetime "created_at", null: false
68-
t.datetime "updated_at", null: false
60+
create_table "states", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
61+
t.string "name"
62+
t.integer "user_id"
63+
t.datetime "created_at", null: false
64+
t.datetime "updated_at", null: false
65+
t.index ["name"], name: "index_states_on_name", unique: true
6966
end
7067

71-
add_index "states", ["name"], name: "index_states_on_name", unique: true, using: :btree
72-
73-
create_table "tags", force: :cascade do |t|
74-
t.string "name", limit: 255
75-
t.integer "user_id", limit: 4
76-
t.string "color", limit: 255
77-
t.datetime "created_at", null: false
78-
t.datetime "updated_at", null: false
68+
create_table "tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
69+
t.string "name"
70+
t.integer "user_id"
71+
t.string "color"
72+
t.datetime "created_at", null: false
73+
t.datetime "updated_at", null: false
7974
end
8075

81-
create_table "users", force: :cascade do |t|
82-
t.string "name", limit: 255
83-
t.string "password_digest", limit: 255
84-
t.string "email", limit: 255
85-
t.datetime "created_at", null: false
86-
t.datetime "updated_at", null: false
76+
create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
77+
t.string "name"
78+
t.string "password_digest"
79+
t.string "email"
80+
t.datetime "created_at", null: false
81+
t.datetime "updated_at", null: false
82+
t.index ["email"], name: "index_users_on_email", unique: true
8783
end
8884

89-
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
90-
9185
add_foreign_key "documents", "folders"
9286
add_foreign_key "documents", "people"
9387
add_foreign_key "documents", "states"

0 commit comments

Comments
 (0)