Skip to content
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

Ash.Seed.seed!(%Module{...}) doesn't work starting 1.3.25 #146

Closed
tfleurant opened this issue May 12, 2023 · 1 comment
Closed

Ash.Seed.seed!(%Module{...}) doesn't work starting 1.3.25 #146

tfleurant opened this issue May 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@tfleurant
Copy link

Describe the bug
With a migrated database, a seeds.ex file containing Ash.Seed.seed!(%Module{...}) fails with the error:

▶ mix run priv/repo/seeds.exs                                                                                                                                                                                 
** (KeyError) key :type not found in: nil. If you are using the dot syntax, such as map.field, make sure the left-hand side of the dot is a map
    (ash_postgres 1.3.25) lib/data_layer.ex:1189: AshPostgres.DataLayer.ecto_changeset/3
    (ash_postgres 1.3.25) lib/data_layer.ex:1105: AshPostgres.DataLayer.create/2
    (ash 2.9.5) lib/ash/changeset/changeset.ex:2001: Ash.Changeset.run_around_actions/2
    (ash 2.9.5) lib/ash/changeset/changeset.ex:1774: Ash.Changeset.transaction_hooks/2
    (ash 2.9.5) lib/ash/changeset/changeset.ex:1699: Ash.Changeset.with_hooks/3
    (ash 2.9.5) lib/ash/seed.ex:85: Ash.Seed.seed!/2

To Reproduce
An example repository can be found here : https://github.com/tfleurant/ash-postgres-seed-bug
To sum up:

  • A simple resource
  • Correct migration created
  • A seed file created with a Ash.Seed.seeds! for the resource
  • mix run the seed file

Expected behavior
The data is inserted.

** Runtime

  • Elixir version : 1.14
  • Erlang version : 25
  • OS : Ubuntu 22.10
  • Ash version 2.9.5
  • Ash Postgres version : 1.3.25

Additional context
It works when rollbacking in 1.3.24

@tfleurant tfleurant added bug Something isn't working needs review labels May 12, 2023
@zachdaniel
Copy link
Contributor

Fixed in 41a2e4f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants