-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong migration order for unique_index when renaming field #159
Labels
bug
Something isn't working
Comments
Just ran into this as well. This happens for non-unque indexes, too defmodule Blog.Resources.Page do
use Ash.Resource,
data_layer: AshPostgres.DataLayer
postgres do
table("pages")
repo(Blog.Repo)
custom_indexes do
- index [:published], unique: false
- index [:published, :published_at], unique: false
+ index [:is_published], unique: false
+ index [:is_published, :published_at], unique: false
end
end
attributes do
uuid_primary_key :id
- attribute :published, :boolean do
+ attribute :is_published, :boolean do
default false
end
attribute :published_at, :naive_datetime do
allow_nil? true
end
end
end This change generates the following:
Note that |
+1 this also occurs when removing a field and a related index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recreating the unique_index should happen after the rename action or do both index actions after the rename
The text was updated successfully, but these errors were encountered: