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

mix ash_postgres.generate_migrations errors out with key :table not found in: nil #140

Closed
bcksl opened this issue Apr 19, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@bcksl
Copy link
Contributor

bcksl commented Apr 19, 2023

Describe the bug

Running mix ash_postgres.generate_migrations errors out with key :table not found in: nil.

The error:

Extension Migrations:
No extensions to install

Generating Tenant Migrations:

Generating Migrations:
** (KeyError) key :table 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.19) lib/migration_generator/migration_generator.ex:129: anonymous fn/2 in AshPostgres.MigrationGenerator.find_references_primary_key/2
    (elixir 1.14.4) lib/enum.ex:4239: Enum.find_value_list/3
    (ash_postgres 1.3.19) lib/migration_generator/migration_generator.ex:109: anonymous fn/2 in AshPostgres.MigrationGenerator.add_references_primary_key/2
    (elixir 1.14.4) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.14.4) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (ash_postgres 1.3.19) lib/migration_generator/migration_generator.ex:100: AshPostgres.MigrationGenerator.add_references_primary_key/2
    (ash_postgres 1.3.19) lib/migration_generator/migration_generator.ex:505: anonymous fn/2 in AshPostgres.MigrationGenerator.deduplicate_snapshots/4
    (elixir 1.14.4) lib/map.ex:258: Map.do_map/2
make: *** [migrations] Error 1

To Reproduce

Time permitting and necessity existing I will try to put together a minimal, let me know.

Expected behavior

Migrations will be generated happily.

Runtime

  • Elixir 1.14.4
  • Erlang/OTP 25 [erts-13.2]
  • Ash* trunk
@bcksl bcksl added bug Something isn't working needs review labels Apr 19, 2023
@zachdaniel
Copy link
Contributor

Can you try main?

@zachdaniel
Copy link
Contributor

Will close this, but comment/reopen if that doesn't fix it :)

@bcksl
Copy link
Contributor Author

bcksl commented Apr 20, 2023

Main didn't fix it for me, but wiping the migrations did.

@zachdaniel
Copy link
Contributor

zachdaniel commented Apr 20, 2023 via email

@bcksl
Copy link
Contributor Author

bcksl commented Apr 22, 2023

Tried regen, didn't cut it. Wiping all migrations did, though.

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