strong_migrations 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +8 -4
- data/lib/strong_migrations/safe_methods.rb +5 -1
- data/lib/strong_migrations/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38cd87929d4889113bc2cc13aa786965c8b86fadf05d1d0439e2c927becfef61
|
4
|
+
data.tar.gz: 0f17d511058c0bd1852adcddf9a2e978b8e407002ddf201be7aedb6c797dd294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d28ef8e2d9cd837fac0a5e72743e1b88e7ef268ce9660e5119c27b50cc0e5215ae20e36a8be570a987e967f4a8bdf47ccd68eb6ee66f7188b787d3d64596c514
|
7
|
+
data.tar.gz: f1e012eed6af3ebcc0ffbf5a1f4b90438ee054597f41a9420a3645af8535fff4cb3ef64b69abdc547fbf20a14658b03f0492395ad46c6bfc79b26726424c81c4
|
data/CHANGELOG.md
CHANGED
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,
|
821
|
+
Only dump the schema when adding a new migration. If you use Git, add to the end of your `Rakefile`:
|
822
822
|
|
823
|
-
```
|
824
|
-
|
825
|
-
|
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
|
-
|
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
|
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.
|
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-
|
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.
|
141
|
+
rubygems_version: 3.2.22
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Catch unsafe migrations in development
|