AF
Ash Framework•4mo ago
jasono

ash_postgres.generate_migrations not working

It recently stopped generating migrations when there are attribute changes to resources. I get "No changes detected, so no migrations or snapshots have been created" I upgraded ash (3.5.24), ash_postgres (2.6.9) and ash_authentication (4.9.4), etc. but it didn't help. In fact, when I removed the "uuid_primary_key :id" line from Token and ran mix ash.codegen remove_id_from_tokens, it still insisted there is no change detected. How can I troubleshoot this?
Solution:
so Token needs to be in some domain, probably Accounts, and Accounts needs to be mentioned in :ash_domains. ``` in config/config.exs import Config ...
Jump to solution
4 Replies
ken-kost
ken-kost•4mo ago
In your config.exs do you have :ash_domains configured? 🤔
Solution
ken-kost
ken-kost•4mo ago
so Token needs to be in some domain, probably Accounts, and Accounts needs to be mentioned in :ash_domains.
# in config/config.exs
import Config

# This tells Ash about your domain, which is used to find
# available resource and actions
config :helpdesk, :ash_domains, [Helpdesk.Support]
# in config/config.exs
import Config

# This tells Ash about your domain, which is used to find
# available resource and actions
config :helpdesk, :ash_domains, [Helpdesk.Support]
https://hexdocs.pm/ash/get-started.html#generators
ken-kost
ken-kost•4mo ago
my hunch is that that might be the issue
jasono
jasonoOP•4mo ago
Interestingash_domains: [MyApp.Accounts... was in runtime.exs, and moving it to config.sys fixed the issue. Why would it matter?

Did you find this page helpful?