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: c54176ffa5402b379ae752cfb6a16a47213f31f6
4
- data.tar.gz: 61c5e351d8d8540725c9c296df00cdc4ff70efb9
3
+ metadata.gz: d0c682bf10734c6ac2a0b7ad8d3516e099d6c25a
4
+ data.tar.gz: 8554e6190e8084490a7af21994fd4f2f1d3bbbcf
5
5
  SHA512:
6
- metadata.gz: a79a860e93a831230f19886aefd0cc53e965175f18ce2e2701b60c19fe716e0f2837531cb8015dd180c75ab139feab0f71555f2e2893578afd0c8566b781a553
7
- data.tar.gz: fe960c837d456b92dafa3236bd0051d910bf0e5b2b66527aa0c1ab5dcc6d8bae14ea655d30c12f1f3efa4a2af441934474334c823cdeedf32e9ca861ccaa4790
6
+ metadata.gz: fae50668e7151864e7bc009ba422b12835e92c5ddfd0f6bb9a62f602f3739c411b39b4338d45e8bec798cbc5057f90d750e6811d97308074f103a64ffe755ba4
7
+ data.tar.gz: af722f194ec9ab5756b29bca89a4067de4c4b177f049acd6c34bb8273ad110512129a97e03400b0d8c28772f9f0007d42e28f9aac3b121ed0f9df2f281f2bffb
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zero_downtime_migrations (0.0.4)
4
+ zero_downtime_migrations (0.0.5)
5
5
  activerecord
6
6
 
7
7
  GEM
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` under the **`development` and `test`** groups.
13
+ Simply add this gem to the project `Gemfile`.
14
14
 
15
15
  ```ruby
16
- gem "zero_downtime_migrations", only: %i(development test)
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::Base.send(:prepend, ZeroDowntimeMigrations::Data)
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.4"
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
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-19 00:00:00.000000000 Z
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