zero_downtime_migrations 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0c682bf10734c6ac2a0b7ad8d3516e099d6c25a
|
4
|
+
data.tar.gz: 8554e6190e8084490a7af21994fd4f2f1d3bbbcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fae50668e7151864e7bc009ba422b12835e92c5ddfd0f6bb9a62f602f3739c411b39b4338d45e8bec798cbc5057f90d750e6811d97308074f103a64ffe755ba4
|
7
|
+
data.tar.gz: af722f194ec9ab5756b29bca89a4067de4c4b177f049acd6c34bb8273ad110512129a97e03400b0d8c28772f9f0007d42e28f9aac3b121ed0f9df2f281f2bffb
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -10,10 +10,10 @@ Catch problematic migrations at development/test time! Heavily inspired by these
|
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
13
|
-
Simply add this gem to the project `Gemfile
|
13
|
+
Simply add this gem to the project `Gemfile`.
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem "zero_downtime_migrations"
|
16
|
+
gem "zero_downtime_migrations"
|
17
17
|
```
|
18
18
|
|
19
19
|
## Usage
|
@@ -3,6 +3,7 @@ require "active_record"
|
|
3
3
|
require_relative "zero_downtime_migrations/data"
|
4
4
|
require_relative "zero_downtime_migrations/dsl"
|
5
5
|
require_relative "zero_downtime_migrations/error"
|
6
|
+
require_relative "zero_downtime_migrations/loader"
|
6
7
|
require_relative "zero_downtime_migrations/migration"
|
7
8
|
require_relative "zero_downtime_migrations/relation"
|
8
9
|
require_relative "zero_downtime_migrations/validation"
|
@@ -12,10 +13,7 @@ require_relative "zero_downtime_migrations/validation/ddl_migration"
|
|
12
13
|
require_relative "zero_downtime_migrations/validation/find_each"
|
13
14
|
require_relative "zero_downtime_migrations/validation/mixed_migration"
|
14
15
|
|
15
|
-
ActiveRecord::
|
16
|
-
ActiveRecord::Migration.send(:prepend, ZeroDowntimeMigrations::Migration)
|
17
|
-
ActiveRecord::Relation.send(:prepend, ZeroDowntimeMigrations::Relation)
|
18
|
-
ActiveRecord::Schema.send(:prepend, ZeroDowntimeMigrations::Migration)
|
16
|
+
ActiveRecord::Migration.send(:prepend, ZeroDowntimeMigrations::Loader)
|
19
17
|
|
20
18
|
module ZeroDowntimeMigrations
|
21
19
|
GEMSPEC = name.underscore.concat(".gemspec")
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module ZeroDowntimeMigrations
|
2
|
+
module Loader
|
3
|
+
def initialize(*)
|
4
|
+
ActiveRecord::Base.send(:prepend, Data)
|
5
|
+
ActiveRecord::Migration.send(:prepend, Migration)
|
6
|
+
ActiveRecord::Relation.send(:prepend, Relation)
|
7
|
+
ActiveRecord::Schema.send(:prepend, Migration)
|
8
|
+
super
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateTableComments < ActiveRecord::Migration[5.0]
|
2
2
|
def change
|
3
3
|
create_table :comments do |t|
|
4
|
-
t.references :user, null: false
|
5
|
-
t.references :post, null: false
|
4
|
+
t.references :user, null: false, index: true
|
5
|
+
t.references :post, null: false, index: true
|
6
6
|
t.text :body, null: false
|
7
7
|
t.timestamps null: false
|
8
8
|
end
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.required_ruby_version = ">= 2.0.0"
|
12
12
|
s.summary = "Zero downtime migrations with ActiveRecord and PostgreSQL"
|
13
13
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
14
|
-
s.version = "0.0.
|
14
|
+
s.version = "0.0.5"
|
15
15
|
|
16
16
|
s.add_dependency "activerecord"
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zero_downtime_migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LendingHome
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/zero_downtime_migrations/data.rb
|
48
48
|
- lib/zero_downtime_migrations/dsl.rb
|
49
49
|
- lib/zero_downtime_migrations/error.rb
|
50
|
+
- lib/zero_downtime_migrations/loader.rb
|
50
51
|
- lib/zero_downtime_migrations/migration.rb
|
51
52
|
- lib/zero_downtime_migrations/relation.rb
|
52
53
|
- lib/zero_downtime_migrations/validation.rb
|