mysql_online_migrations 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +14 -10
- data/README.md +11 -3
- data/gemfiles/rails3.gemfile +1 -1
- data/gemfiles/rails4.gemfile +4 -4
- data/gemfiles/rails4_1.gemfile +7 -0
- data/gemfiles/rails4_2.gemfile +7 -0
- data/lib/mysql_online_migrations.rb +6 -2
- data/lib/mysql_online_migrations/mysql2_adapter_without_lock.rb +5 -3
- data/mysql_online_migrations.gemspec +1 -1
- data/spec/fixtures/db/migrate/20140108194650_create_test_rake.rb +5 -0
- data/spec/lib/migration/tasks_spec.rb +38 -0
- data/spec/lib/mysql_online_migrations/mysql2_adapter_without_lock_spec.rb +14 -9
- data/spec/lib/mysql_online_migrations_spec.rb +17 -11
- data/spec/spec_helper.rb +0 -1
- data/spec/support/helpers.rb +13 -4
- data/spec/support/shared_examples/migration.rb +4 -4
- metadata +26 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9724fc320f228577f55555c74b81e3a1a05ad671
|
4
|
+
data.tar.gz: 89cc3177780f255b8ace7464b07422dabe06bde6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96f9012aad912e8c0c78d10135541a014568cf97803c1249b9cf44905a83f008c11808adea0ac2f2e3e1e4dac35dac0a0dc603927fa64f8c1cf473b7103a72e4
|
7
|
+
data.tar.gz: 6c7fd34bd152f5ec8844158f5b354f87fa4961c72e6ad3dceaa36cd3273a9cdfefe5a18f3465df9baea4d14d498a3cdce58ff4b121921fc753732160a99eeb37
|
data/.travis.yml
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
3
|
- 2.0.0
|
4
|
+
- 2.1.5
|
5
|
+
- 2.2.0
|
4
6
|
|
5
7
|
before_script:
|
6
8
|
- mysql -e 'create database mysql_online_migrations;'
|
@@ -8,5 +10,7 @@ before_script:
|
|
8
10
|
gemfile:
|
9
11
|
- gemfiles/rails3.gemfile
|
10
12
|
- gemfiles/rails4.gemfile
|
13
|
+
- gemfiles/rails4_1.gemfile
|
14
|
+
- gemfiles/rails4_2.gemfile
|
11
15
|
|
12
|
-
script: bundle exec rspec spec
|
16
|
+
script: bundle exec rspec spec
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
2
|
-
gemspec
|
1
|
+
source "https://rubygems.org"
|
2
|
+
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mysql_online_migrations (1.0.
|
4
|
+
mysql_online_migrations (1.0.2)
|
5
5
|
activerecord (>= 3.2.15)
|
6
6
|
activesupport (>= 3.2.15)
|
7
7
|
mysql2
|
8
8
|
|
9
9
|
GEM
|
10
|
-
remote:
|
10
|
+
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
activemodel (4.0.2)
|
13
13
|
activesupport (= 4.0.2)
|
@@ -39,14 +39,18 @@ GEM
|
|
39
39
|
coderay (~> 1.0.5)
|
40
40
|
method_source (~> 0.8)
|
41
41
|
slop (~> 3.4)
|
42
|
-
rspec (
|
43
|
-
rspec-core (~>
|
44
|
-
rspec-expectations (~>
|
45
|
-
rspec-mocks (~>
|
46
|
-
rspec-core (
|
47
|
-
|
48
|
-
|
49
|
-
|
42
|
+
rspec (3.1.0)
|
43
|
+
rspec-core (~> 3.1.0)
|
44
|
+
rspec-expectations (~> 3.1.0)
|
45
|
+
rspec-mocks (~> 3.1.0)
|
46
|
+
rspec-core (3.1.7)
|
47
|
+
rspec-support (~> 3.1.0)
|
48
|
+
rspec-expectations (3.1.2)
|
49
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
50
|
+
rspec-support (~> 3.1.0)
|
51
|
+
rspec-mocks (3.1.3)
|
52
|
+
rspec-support (~> 3.1.0)
|
53
|
+
rspec-support (3.1.2)
|
50
54
|
slop (3.4.6)
|
51
55
|
thread_safe (0.1.3)
|
52
56
|
atomic
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
mysql_online_migrations
|
2
2
|
=======================
|
3
3
|
|
4
|
-
Patch Rails migrations to enforce MySQL 5.6 online migrations
|
4
|
+
Patch Rails migrations to enforce MySQL 5.6 online migrations
|
5
5
|
Prior to MySQL 5.6, when adding / removing / renaming indexes and columns, MySQL would lock the writes of the whole table.
|
6
|
-
MySQL 5.6 by default will try to apply the least locking possible. You however don't know what kind of locking it applies and there's situations where it can't allow writes during a migration (See Caveats).
|
6
|
+
MySQL 5.6 by default will try to apply the least locking possible. You however don't know what kind of locking it applies and there's situations where it can't allow writes during a migration (See Caveats).
|
7
7
|
This gem enforces `LOCK=NONE` in all migration statements of Rails. Therefore, you're getting an error when MySQL cannot write during the migration so there's no surprise when rolling out in production.
|
8
8
|
|
9
9
|
|
@@ -54,7 +54,15 @@ with_lock do
|
|
54
54
|
end
|
55
55
|
`````
|
56
56
|
|
57
|
-
The `with_lock` method will be useful when hitting the caveats of `LOCK=NONE`. Please read the
|
57
|
+
The `with_lock` method will be useful when hitting the caveats of `LOCK=NONE`. Please read the 'Caveats' section.
|
58
|
+
|
59
|
+
### Enable verbose output
|
60
|
+
To enable an 'ONLINE MIGRATION' debug statement whenever an online migration is
|
61
|
+
run, simply set the `MysqlOnlineMigrations.verbose` module variable to true.
|
62
|
+
Example (in a Rails app's config/initializers/mysql_online_migrations.rb):
|
63
|
+
````
|
64
|
+
MysqlOnlineMigrations.verbose = true
|
65
|
+
````
|
58
66
|
|
59
67
|
Caveats
|
60
68
|
=======================
|
data/gemfiles/rails3.gemfile
CHANGED
data/gemfiles/rails4.gemfile
CHANGED
@@ -7,6 +7,9 @@ require "active_record/connection_adapters/mysql2_adapter"
|
|
7
7
|
end
|
8
8
|
|
9
9
|
module MysqlOnlineMigrations
|
10
|
+
|
11
|
+
class << self; attr_accessor :verbose; end
|
12
|
+
|
10
13
|
def self.prepended(base)
|
11
14
|
ActiveRecord::Base.send(:class_attribute, :mysql_online_migrations, :instance_writer => false)
|
12
15
|
ActiveRecord::Base.send("mysql_online_migrations=", true)
|
@@ -22,7 +25,7 @@ module MysqlOnlineMigrations
|
|
22
25
|
original_connection.instance_variable_get(:@delegate)
|
23
26
|
end
|
24
27
|
|
25
|
-
@no_lock_adapter ||= ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock.new(@original_adapter)
|
28
|
+
@no_lock_adapter ||= ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock.new(@original_adapter, MysqlOnlineMigrations.verbose)
|
26
29
|
|
27
30
|
if adapter_mode
|
28
31
|
@no_lock_adapter
|
@@ -38,6 +41,7 @@ module MysqlOnlineMigrations
|
|
38
41
|
yield
|
39
42
|
ActiveRecord::Base.mysql_online_migrations = original_value
|
40
43
|
end
|
44
|
+
|
41
45
|
end
|
42
46
|
|
43
|
-
ActiveRecord::Migration.send(:prepend, MysqlOnlineMigrations)
|
47
|
+
ActiveRecord::Migration.send(:prepend, MysqlOnlineMigrations)
|
@@ -1,11 +1,13 @@
|
|
1
1
|
module ActiveRecord
|
2
2
|
module ConnectionAdapters
|
3
3
|
class Mysql2AdapterWithoutLock < Mysql2Adapter
|
4
|
+
|
4
5
|
OPTIMIZABLE_DDL_REGEX = /^(alter|create (unique )? ?index|drop index) /i
|
5
6
|
DDL_WITH_COMMA_REGEX = /^alter /i
|
6
7
|
DDL_WITH_LOCK_NONE_REGEX = / LOCK=NONE\s*$/i
|
7
8
|
|
8
|
-
def initialize(mysql2_adapter)
|
9
|
+
def initialize(mysql2_adapter, verbose = false)
|
10
|
+
@verbose = verbose
|
9
11
|
params = [:@connection, :@logger, :@connection_options, :@config].map do |sym|
|
10
12
|
mysql2_adapter.instance_variable_get(sym)
|
11
13
|
end
|
@@ -24,9 +26,9 @@ module ActiveRecord
|
|
24
26
|
return "" unless ActiveRecord::Base.mysql_online_migrations
|
25
27
|
return "" if sql =~ DDL_WITH_LOCK_NONE_REGEX
|
26
28
|
comma_delimiter = (sql =~ DDL_WITH_COMMA_REGEX ? "," : "")
|
27
|
-
puts "ONLINE MIGRATION"
|
29
|
+
puts "ONLINE MIGRATION" if @verbose
|
28
30
|
"#{comma_delimiter} LOCK=NONE"
|
29
31
|
end
|
30
32
|
end
|
31
33
|
end
|
32
|
-
end
|
34
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'mysql_online_migrations'
|
3
|
-
s.version = '1.0.
|
3
|
+
s.version = '1.0.3'
|
4
4
|
s.summary = "Use MySQL 5.6+ capacities to enforce online migrations"
|
5
5
|
s.description = "MySQL 5.6 adds a `LOCK=NONE` option to make sure migrations are done with no locking. Let's use it."
|
6
6
|
s.authors = ["Anthony Alberto"]
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Migration Tasks" do
|
4
|
+
after(:each) do
|
5
|
+
@adapter_without_lock.drop_table :test_rake rescue nil
|
6
|
+
clear_version
|
7
|
+
end
|
8
|
+
|
9
|
+
context 'db:migrate' do
|
10
|
+
it "creates the expected column" do
|
11
|
+
expect(@adapter_without_lock.tables).not_to include("test_rake")
|
12
|
+
ActiveRecord::Migrator.migrate("spec/fixtures/db/migrate")
|
13
|
+
expect(@adapter_without_lock.tables).to include("test_rake")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when rolling back' do
|
18
|
+
before(:each) do
|
19
|
+
@adapter_without_lock.create_table :test_rake
|
20
|
+
expect(@adapter_without_lock.tables).to include("test_rake")
|
21
|
+
insert_version(20140108194650)
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'db:rollback' do
|
25
|
+
it "drops the expected table" do
|
26
|
+
ActiveRecord::Migrator.rollback("spec/fixtures/db/migrate", 1)
|
27
|
+
expect(@adapter_without_lock.tables).not_to include("test_rake")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'db:migrate:down' do
|
32
|
+
it "drops the expected table" do
|
33
|
+
ActiveRecord::Migrator.run(:down, "spec/fixtures/db/migrate", 20140108194650)
|
34
|
+
expect(@adapter_without_lock.tables).not_to include("test_rake")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -3,7 +3,12 @@ require "spec_helper"
|
|
3
3
|
describe ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock do
|
4
4
|
context "#initialize" do
|
5
5
|
it "successfully instantiates a working adapter" do
|
6
|
-
ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock.new(@adapter).
|
6
|
+
expect(ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock.new(@adapter)).to be_active
|
7
|
+
end
|
8
|
+
|
9
|
+
it "successfully instantiates a working adapter with verbose output" do
|
10
|
+
instance = ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock.new(@adapter, true)
|
11
|
+
expect(instance.instance_variable_get(:@verbose)).to be_truthy
|
7
12
|
end
|
8
13
|
end
|
9
14
|
|
@@ -12,24 +17,24 @@ describe ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock do
|
|
12
17
|
context "with alter" do
|
13
18
|
let(:query) { "alter " }
|
14
19
|
it "adds ', LOCK=NONE'" do
|
15
|
-
@adapter_without_lock.lock_none_statement("alter ").
|
20
|
+
expect(@adapter_without_lock.lock_none_statement("alter ")).to eq(", LOCK=NONE")
|
16
21
|
end
|
17
22
|
end
|
18
23
|
context "with drop index" do
|
19
24
|
let(:query) { "drop index " }
|
20
25
|
it "adds ' LOCK=NONE'" do
|
21
|
-
@adapter_without_lock.lock_none_statement("drop index ").
|
26
|
+
expect(@adapter_without_lock.lock_none_statement("drop index ")).to eq(" LOCK=NONE")
|
22
27
|
end
|
23
28
|
end
|
24
29
|
context "with create index" do
|
25
30
|
let(:query) { "create index " }
|
26
31
|
it "adds ' LOCK=NONE'" do
|
27
|
-
@adapter_without_lock.lock_none_statement("create index ").
|
32
|
+
expect(@adapter_without_lock.lock_none_statement("create index ")).to eq(" LOCK=NONE")
|
28
33
|
end
|
29
34
|
end
|
30
35
|
context "with a query with LOCK=NONE already there" do
|
31
36
|
it "doesn't add anything" do
|
32
|
-
@adapter_without_lock.lock_none_statement("alter LOCK=NONE ").
|
37
|
+
expect(@adapter_without_lock.lock_none_statement("alter LOCK=NONE ")).to eq("")
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
@@ -44,7 +49,7 @@ describe ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock do
|
|
44
49
|
end
|
45
50
|
|
46
51
|
it "doesn't add anything to the request" do
|
47
|
-
@adapter_without_lock.lock_none_statement("alter ").
|
52
|
+
expect(@adapter_without_lock.lock_none_statement("alter ")).to eq("")
|
48
53
|
end
|
49
54
|
end
|
50
55
|
end
|
@@ -54,14 +59,14 @@ describe ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock do
|
|
54
59
|
it "adds LOCK=NONE at the end of the query" do
|
55
60
|
comma = query =~ /alter /i ? "," : ""
|
56
61
|
expected_output = "#{query} #{comma} LOCK=NONE"
|
57
|
-
@adapter_without_lock.
|
62
|
+
expect(@adapter_without_lock).to receive(:original_execute).with(expected_output, nil)
|
58
63
|
@adapter_without_lock.execute(query)
|
59
64
|
end
|
60
65
|
end
|
61
66
|
|
62
67
|
shared_examples_for "#execute that doesn't change the SQL" do
|
63
68
|
it "just passes the query to original_execute" do
|
64
|
-
@adapter_without_lock.
|
69
|
+
expect(@adapter_without_lock).to receive(:original_execute).with(query, nil)
|
65
70
|
@adapter_without_lock.execute(query)
|
66
71
|
end
|
67
72
|
end
|
@@ -134,4 +139,4 @@ describe ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock do
|
|
134
139
|
end
|
135
140
|
end
|
136
141
|
end
|
137
|
-
end
|
142
|
+
end
|
@@ -5,27 +5,33 @@ describe MysqlOnlineMigrations do
|
|
5
5
|
|
6
6
|
context ".prepended" do
|
7
7
|
it "sets ActiveRecord::Base.mysql_online_migrations to true" do
|
8
|
-
ActiveRecord::Base.mysql_online_migrations.
|
8
|
+
expect(ActiveRecord::Base.mysql_online_migrations).to be_truthy
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
context "#connection" do
|
13
|
-
shared_examples_for "Mysql2AdapterWithoutLock created" do
|
13
|
+
shared_examples_for "Mysql2AdapterWithoutLock created" do |verbose|
|
14
14
|
it "memoizes an instance of Mysql2AdapterWithoutLock" do
|
15
|
-
|
16
|
-
|
15
|
+
MysqlOnlineMigrations.verbose = verbose
|
16
|
+
|
17
|
+
expect(ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock).to receive(:new)
|
18
|
+
.with(an_instance_of(ActiveRecord::ConnectionAdapters::Mysql2Adapter), verbose).once.and_call_original
|
17
19
|
3.times { migration.connection }
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
21
23
|
context 'when migrating' do
|
22
24
|
it "returns an instance of Mysql2AdapterWithoutLock" do
|
23
|
-
migration.connection.
|
25
|
+
expect(migration.connection).to be_an_instance_of(ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock)
|
24
26
|
end
|
25
27
|
|
26
28
|
it_behaves_like "Mysql2AdapterWithoutLock created"
|
27
29
|
end
|
28
30
|
|
31
|
+
context 'when migrating with verbose output' do
|
32
|
+
it_behaves_like "Mysql2AdapterWithoutLock created", true
|
33
|
+
end
|
34
|
+
|
29
35
|
context 'when rolling back' do
|
30
36
|
before do
|
31
37
|
migration.instance_variable_set(:@connection, ActiveRecord::Migration::CommandRecorder.new(ActiveRecord::Base.connection))
|
@@ -33,8 +39,8 @@ describe MysqlOnlineMigrations do
|
|
33
39
|
|
34
40
|
it "returns an instance of ActiveRecord::Migration::CommandRecorder" do
|
35
41
|
recorder_connection = migration.connection
|
36
|
-
recorder_connection.
|
37
|
-
recorder_connection.instance_variable_get(:@delegate).
|
42
|
+
expect(recorder_connection).to be_an_instance_of(ActiveRecord::Migration::CommandRecorder)
|
43
|
+
expect(recorder_connection.instance_variable_get(:@delegate)).to be_an_instance_of(ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock)
|
38
44
|
end
|
39
45
|
|
40
46
|
it_behaves_like "Mysql2AdapterWithoutLock created"
|
@@ -43,11 +49,11 @@ describe MysqlOnlineMigrations do
|
|
43
49
|
|
44
50
|
context "#with_lock" do
|
45
51
|
it "switches mysql_online_migrations flag to false and then back to original value after block execution" do
|
46
|
-
ActiveRecord::Base.mysql_online_migrations.
|
52
|
+
expect(ActiveRecord::Base.mysql_online_migrations).to be_truthy
|
47
53
|
migration.with_lock do
|
48
|
-
ActiveRecord::Base.mysql_online_migrations.
|
54
|
+
expect(ActiveRecord::Base.mysql_online_migrations).to be_falsy
|
49
55
|
end
|
50
|
-
ActiveRecord::Base.mysql_online_migrations.
|
56
|
+
expect(ActiveRecord::Base.mysql_online_migrations).to be_truthy
|
51
57
|
end
|
52
58
|
end
|
53
|
-
end
|
59
|
+
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/helpers.rb
CHANGED
@@ -22,17 +22,17 @@ module Helpers
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def unstub_execute
|
25
|
-
@adapter.
|
25
|
+
allow(@adapter).to receive(:execute).and_call_original
|
26
26
|
end
|
27
27
|
|
28
28
|
def stub_adapter_without_lock
|
29
|
-
ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock.
|
29
|
+
allow(ActiveRecord::ConnectionAdapters::Mysql2AdapterWithoutLock).to receive(:new).and_return(@adapter_without_lock)
|
30
30
|
end
|
31
31
|
|
32
32
|
def stub_execute(adapter, original_method, method_to_call)
|
33
33
|
original_execute = adapter.method(original_method)
|
34
34
|
|
35
|
-
adapter.
|
35
|
+
allow(adapter).to receive(original_method) do |sql|
|
36
36
|
if sql =~ CATCH_STATEMENT_REGEX
|
37
37
|
send(method_to_call, sql.squeeze(' ').strip)
|
38
38
|
else
|
@@ -96,11 +96,20 @@ module Helpers
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def set_ar_setting(value)
|
99
|
-
ActiveRecord::Base.
|
99
|
+
allow(ActiveRecord::Base).to receive(:mysql_online_migrations).and_return(value)
|
100
100
|
end
|
101
101
|
|
102
102
|
def teardown
|
103
103
|
@adapter.drop_table :testing rescue nil
|
104
|
+
@adapter.drop_table :test_rake rescue nil
|
104
105
|
ActiveRecord::Base.primary_key_prefix_type = nil
|
105
106
|
end
|
107
|
+
|
108
|
+
def insert_version(version)
|
109
|
+
@adapter_without_lock.execute("INSERT into schema_migrations VALUES('#{version}')")
|
110
|
+
end
|
111
|
+
|
112
|
+
def clear_version
|
113
|
+
@adapter_without_lock.execute("TRUNCATE schema_migrations")
|
114
|
+
end
|
106
115
|
end
|
@@ -33,10 +33,10 @@ shared_examples_for "a migration that adds LOCK=NONE when needed" do
|
|
33
33
|
raise e unless @rescue_statement_when_stubbed
|
34
34
|
end
|
35
35
|
|
36
|
-
@queries_received_by_regular_adapter.length.
|
37
|
-
@queries_received_by_regular_adapter.length.
|
36
|
+
expect(@queries_received_by_regular_adapter.length).to be > 0
|
37
|
+
expect(@queries_received_by_regular_adapter.length).to eq(@queries_received_by_adapter_without_lock.length)
|
38
38
|
@queries_received_by_regular_adapter.each_with_index do |query, index|
|
39
|
-
@queries_received_by_adapter_without_lock[index].
|
39
|
+
expect(@queries_received_by_adapter_without_lock[index]).to eq(add_lock_none(query, comma_before_lock_none))
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -62,7 +62,7 @@ shared_examples_for "a migration with a non-lockable statement" do
|
|
62
62
|
begin
|
63
63
|
migration.migrate(:up)
|
64
64
|
rescue ActiveRecord::StatementInvalid => e
|
65
|
-
e.message.
|
65
|
+
expect(e.message).to match(/LOCK=NONE is not supported/)
|
66
66
|
end
|
67
67
|
rebuild_table
|
68
68
|
end
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_online_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Alberto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.15
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.15
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 3.2.15
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 3.2.15
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mysql2
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: logger
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: MySQL 5.6 adds a `LOCK=NONE` option to make sure migrations are done
|
@@ -101,21 +101,25 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- .rspec
|
106
|
-
- .travis.yml
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
107
|
- Gemfile
|
108
108
|
- Gemfile.lock
|
109
109
|
- LICENSE
|
110
110
|
- README.md
|
111
111
|
- gemfiles/rails3.gemfile
|
112
112
|
- gemfiles/rails4.gemfile
|
113
|
+
- gemfiles/rails4_1.gemfile
|
114
|
+
- gemfiles/rails4_2.gemfile
|
113
115
|
- lib/mysql_online_migrations.rb
|
114
116
|
- lib/mysql_online_migrations/mysql2_adapter_without_lock.rb
|
115
117
|
- mysql_online_migrations.gemspec
|
118
|
+
- spec/fixtures/db/migrate/20140108194650_create_test_rake.rb
|
116
119
|
- spec/lib/migration/column_spec.rb
|
117
120
|
- spec/lib/migration/index_spec.rb
|
118
121
|
- spec/lib/migration/table_spec.rb
|
122
|
+
- spec/lib/migration/tasks_spec.rb
|
119
123
|
- spec/lib/mysql_online_migrations/mysql2_adapter_without_lock_spec.rb
|
120
124
|
- spec/lib/mysql_online_migrations_spec.rb
|
121
125
|
- spec/spec_helper.rb
|
@@ -131,24 +135,26 @@ require_paths:
|
|
131
135
|
- lib
|
132
136
|
required_ruby_version: !ruby/object:Gem::Requirement
|
133
137
|
requirements:
|
134
|
-
- -
|
138
|
+
- - ">="
|
135
139
|
- !ruby/object:Gem::Version
|
136
140
|
version: '0'
|
137
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
142
|
requirements:
|
139
|
-
- -
|
143
|
+
- - ">="
|
140
144
|
- !ruby/object:Gem::Version
|
141
145
|
version: '0'
|
142
146
|
requirements: []
|
143
147
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.
|
148
|
+
rubygems_version: 2.2.2
|
145
149
|
signing_key:
|
146
150
|
specification_version: 4
|
147
151
|
summary: Use MySQL 5.6+ capacities to enforce online migrations
|
148
152
|
test_files:
|
153
|
+
- spec/fixtures/db/migrate/20140108194650_create_test_rake.rb
|
149
154
|
- spec/lib/migration/column_spec.rb
|
150
155
|
- spec/lib/migration/index_spec.rb
|
151
156
|
- spec/lib/migration/table_spec.rb
|
157
|
+
- spec/lib/migration/tasks_spec.rb
|
152
158
|
- spec/lib/mysql_online_migrations/mysql2_adapter_without_lock_spec.rb
|
153
159
|
- spec/lib/mysql_online_migrations_spec.rb
|
154
160
|
- spec/spec_helper.rb
|