strong_migrations 0.7.7 → 0.7.8

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
  SHA256:
3
- metadata.gz: de58409c64c5050d99432576f5d38f615de75832de7214960f9f686248bfa31c
4
- data.tar.gz: d6113e7875c2b0f75e4548117692af874ffa12d7ebea731ed94344069661399d
3
+ metadata.gz: 38cd87929d4889113bc2cc13aa786965c8b86fadf05d1d0439e2c927becfef61
4
+ data.tar.gz: 0f17d511058c0bd1852adcddf9a2e978b8e407002ddf201be7aedb6c797dd294
5
5
  SHA512:
6
- metadata.gz: 23655309809f41dbe53842ee01ac8f573153ed49936f003bef0076591ec26f2bff7464c32fbf35ca8e2037e2eb8227c0e6c12b2e8c609e9cd05ccd6127474620
7
- data.tar.gz: 501307d37d8577552735553b0e4b6f96f9afa415d3ed5737a06f16c44227ad7996daea70a9b2a480303678135c45806c410eacce03e125a92c2929b531bbdb34
6
+ metadata.gz: d28ef8e2d9cd837fac0a5e72743e1b88e7ef268ce9660e5119c27b50cc0e5215ae20e36a8be570a987e967f4a8bdf47ccd68eb6ee66f7188b787d3d64596c514
7
+ data.tar.gz: f1e012eed6af3ebcc0ffbf5a1f4b90438ee054597f41a9420a3645af8535fff4cb3ef64b69abdc547fbf20a14658b03f0492395ad46c6bfc79b26726424c81c4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.7.8 (2021-08-03)
2
+
3
+ - Fixed issue with `add_reference ..., foreign_key: {to_table: ...}` with `safe_by_default`
4
+
1
5
  ## 0.7.7 (2021-06-07)
2
6
 
3
7
  - Removed timeouts and `auto_analyze` from schema load
data/README.md CHANGED
@@ -818,11 +818,15 @@ StrongMigrations.auto_analyze = true
818
818
 
819
819
  ## Faster Migrations
820
820
 
821
- Only dump the schema when adding a new migration. If you use Git, create an initializer with:
821
+ Only dump the schema when adding a new migration. If you use Git, add to the end of your `Rakefile`:
822
822
 
823
- ```ruby
824
- ActiveRecord::Base.dump_schema_after_migration = Rails.env.development? &&
825
- `git status db/migrate/ --porcelain`.present?
823
+ ```rb
824
+ task :faster_migrations do
825
+ ActiveRecord::Base.dump_schema_after_migration = Rails.env.development? &&
826
+ `git status db/migrate/ --porcelain`.present?
827
+ end
828
+
829
+ task "db:migrate": "faster_migrations"
826
830
  ```
827
831
 
828
832
  ## Schema Sanity
@@ -30,7 +30,11 @@ module StrongMigrations
30
30
  (ActiveRecord::Base.pluralize_table_names ? reference.to_s.pluralize : reference).to_sym
31
31
  end
32
32
 
33
- @migration.add_foreign_key(table, name)
33
+ if reference
34
+ @migration.add_foreign_key(table, name, column: "#{reference}_id")
35
+ else
36
+ @migration.add_foreign_key(table, name)
37
+ end
34
38
  end
35
39
  end
36
40
  dir.down do
@@ -1,3 +1,3 @@
1
1
  module StrongMigrations
2
- VERSION = "0.7.7"
2
+ VERSION = "0.7.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-06-07 00:00:00.000000000 Z
13
+ date: 2021-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.2.3
141
+ rubygems_version: 3.2.22
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Catch unsafe migrations in development