declare_schema 1.2.3.pre.ga.5 → 1.2.3.pre.ga.6
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/Gemfile.lock +1 -1
- data/lib/declare_schema/version.rb +1 -1
- data/lib/generators/declare_schema/migration/migrator.rb +7 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0681126cdd17705ec35f41ab9e4dc608fbc961b50614124ace54e17c49675eca'
|
4
|
+
data.tar.gz: efa69b2eb51fa5e2a9ec5b22ed04ecdf91679abecfb674646ea7e461974a097e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69d913a279f29f6368ceb224791213d9bc711e27c8a4a598f7feeb720bf753c5b6e5d65e7537655979b9bc6da5ee663c69f8c9dc2a8e2156b5b1e1c7608cc03b
|
7
|
+
data.tar.gz: 5f4b21eb05fc804a883f5bef692bf3473e25b8a61e066cf094e363b46be27fede8fc520efebc04a49ccd4e3c56fa7bddfcb5713204c828dba146904423781535
|
data/Gemfile.lock
CHANGED
@@ -469,7 +469,7 @@ module Generators
|
|
469
469
|
end
|
470
470
|
|
471
471
|
def index_changes_due_to_column_renames(indexes_to_drop, indexes_to_add, to_rename)
|
472
|
-
indexes_to_drop.each_with_object([], []) do |index_to_drop, (renamed_indexes_to_drop, renamed_indexes_to_add)|
|
472
|
+
indexes_to_drop.each_with_object([[], []]) do |index_to_drop, (renamed_indexes_to_drop, renamed_indexes_to_add)|
|
473
473
|
renamed_columns = index_to_drop.columns.map do |column|
|
474
474
|
to_rename.fetch(column, column)
|
475
475
|
end.sort
|
@@ -508,16 +508,15 @@ module Generators
|
|
508
508
|
end
|
509
509
|
|
510
510
|
def foreign_key_changes_due_to_column_renames(fks_to_drop, fks_to_add, to_rename)
|
511
|
-
fks_to_drop.each_with_object([], []) do |fk_to_drop, (renamed_fks_to_drop, renamed_fks_to_add)|
|
512
|
-
if (
|
511
|
+
fks_to_drop.each_with_object([[], []]) do |fk_to_drop, (renamed_fks_to_drop, renamed_fks_to_add)|
|
512
|
+
if (fk_to_add = fks_to_add.find do |fk_to_add|
|
513
513
|
fk_to_add.foreign_key.nil? and raise "Foreign key is not allowed to be nil for #{fk_to_add.inspect}"
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
end
|
514
|
+
fk_to_add.child_table_name == fk_to_drop.child_table_name &&
|
515
|
+
fk_to_add.parent_table_name == fk_to_drop.parent_table_name &&
|
516
|
+
fk_to_add.foreign_key == to_rename[fk_to_drop.foreign_key]
|
518
517
|
end)
|
519
518
|
renamed_fks_to_drop << fk_to_drop
|
520
|
-
renamed_fks_to_add <<
|
519
|
+
renamed_fks_to_add << fk_to_add
|
521
520
|
end
|
522
521
|
end
|
523
522
|
end
|