Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitae3f2c0

Browse files
committed
fix: sort index operations last
1 parent65d7946 commitae3f2c0

File tree

1 file changed

+9
-32
lines changed

1 file changed

+9
-32
lines changed

‎lib/migration_generator/migration_generator.ex‎

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,11 @@ defmodule AshPostgres.MigrationGenerator do
836836

837837
defpafter?(
838838
%Operation.AddUniqueIndex{
839-
identity:%{keys:keys},
840-
table:table,
841-
multitenancy:multitenancy
839+
table:table
842840
},
843-
%Operation.AddAttribute{table:table,attribute:%{name:name}}
841+
%{table:table}
844842
)do
845-
nameinkeys||(multitenancy.attribute&&name==multitenancy.attribute)
843+
true
846844
end
847845

848846
defpafter?(
@@ -857,28 +855,11 @@ defmodule AshPostgres.MigrationGenerator do
857855
(multitenancy.attribute&&multitenancy.attributeinList.wrap(attribute_or_attributes))
858856
end
859857

860-
defpafter?(%Operation.AddUniqueIndex{table:table},%Operation.RemoveUniqueIndex{table:table}),
861-
do:true
862-
863858
defpafter?(%Operation.AddCheckConstraint{table:table},%Operation.RemoveCheckConstraint{
864859
table:table
865860
}),
866861
do:true
867862

868-
defpafter?(
869-
%Operation.AddUniqueIndex{identity:%{keys:keys},table:table},
870-
%Operation.AlterAttribute{table:table,new_attribute:%{name:name}}
871-
)do
872-
nameinkeys
873-
end
874-
875-
defpafter?(
876-
%Operation.AddUniqueIndex{identity:%{keys:keys},table:table},
877-
%Operation.RenameAttribute{table:table,new_attribute:%{name:name}}
878-
)do
879-
nameinkeys
880-
end
881-
882863
defpafter?(
883864
%Operation.AddCheckConstraint{
884865
constraint:%{attribute:attribute_or_attributes},
@@ -900,17 +881,17 @@ defmodule AshPostgres.MigrationGenerator do
900881
end
901882

902883
defpafter?(
903-
%Operation.RemoveUniqueIndex{identity:%{keys:keys},table:table},
904-
%Operation.RemoveAttribute{table:table,attribute:%{name:name}}
884+
%Operation.RemoveUniqueIndex{table:table},
885+
%Operation.AddUniqueIndex{table:table}
905886
)do
906-
nameinkeys
887+
false
907888
end
908889

909890
defpafter?(
910-
%Operation.RemoveUniqueIndex{identity:%{keys:keys},table:table},
911-
%Operation.RenameAttribute{table:table,old_attribute:%{name:name}}
891+
%Operation.RemoveUniqueIndex{table:table},
892+
%{table:table}
912893
)do
913-
nameinkeys
894+
true
914895
end
915896

916897
defpafter?(
@@ -1011,10 +992,6 @@ defmodule AshPostgres.MigrationGenerator do
1011992
),
1012993
do:true
1013994

1014-
defpafter?(%Operation.AddUniqueIndex{table:table},%Operation.CreateTable{table:table})do
1015-
true
1016-
end
1017-
1018995
defpafter?(%Operation.AddCheckConstraint{table:table},%Operation.CreateTable{table:table})do
1019996
true
1020997
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp