ash-project / ash_postgres

The PostgreSQL data layer for Ash Framework
https://hexdocs.pm/ash_postgres
MIT License
140 stars 73 forks source link

Table names generated by the generators should be pluralized #354

Closed rbino closed 4 months ago

rbino commented 4 months ago

Describe the bug Currently, the ash.gen.resource generator generates singular names in the postgres section. They should be pluralized since this is the usual convention and what users probably expect as default.

To Reproduce

mix ash.gen.resource MyApp.Accounts.User --uuid-primary-key id --attribute email:ci_string:required:public --extend postgres

generates this postgres section

postgres do
  table "user"
  repo MyApp.Repo
end

Expected behavior This postgres section would have to be generated instead

postgres do
  table "users"
  repo MyApp.Repo
end