Postgresql error after migrating to ash_archival
I get this error: * (Postgrex.Error) ERROR 42703 (undefined_column) column "archived_at" does not exist
After running the migration of AshArchival on my User resource
It didn't create the archived_at column for some reason
All I did is add the
AshArchival
to my extensions.
here is the error:
```
[info] drop index if exists users_unique_email_index
[info] create index users_unique_email_index
[error] (Postgrex.Error) ERROR 42703 (undefined_column) column "archived_at" does not exist
(ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1096: Ecto.Adapters.SQL.raise_sql_call_error/1
(elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
(ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1203: Ecto.Adapters.SQL.execute_ddl/4
(ecto_sql 3.12.1) lib/ecto/migration/runner.ex:348: Ecto.Migration.Runner.log_and_execute_ddl/3
(elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
(elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
(ecto_sql 3.12.1) lib/ecto/migration/runner.ex:311: Ecto.Migration.Runner.perform_operation/3
(stdlib 6.2.2) timer.erl:595: :timer.tc/2
(ecto_sql 3.12.1) lib/ecto/migration/runner.ex:25: Ecto.Migration.Runner.run/8
(ecto_sql 3.12.1) lib/ecto/migrator.ex:365: Ecto.Migrator.attempt/8
(ecto_sql 3.12.1) lib/ecto/migrator.ex:282: anonymous fn/5 in Ecto.Migrator.do_up/5
(ecto_sql 3.12.1) lib/ecto/migrator.ex:337: anonymous fn/6 in Ecto.Migrator.async_migrate_maybe_in_transaction/7
(ecto_sql 3.12.1) lib/ecto/adapters/sql.ex:1400: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
(db_connection 2.7.0) lib/db_connection.ex:1756: DBConnection.run_transaction/4
(ecto_sql 3.12.1) lib/ecto/migrator.ex:354: Ecto.Migrator.run_maybe_in_transaction/5
(elixir 1.18.3) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
(elixir 1.18.3) lib/task/supervised.ex:36: Task.Supervised.reply/4
```6 Replies
Solution
Did you run
mix ash.codegen
to generate migrations?@Zach Daniel oddly enough, running the command manually (with
--dev
) actually worked. I usually press the button in the UI.Ah, interesting 🤔
Are you on the latest version of ash_phoenix?
actually it might be all the packages
{:ash_phoenix, "~> 2.0"}
there was a case where the task wouldn't be reenabled
so would only work once
waw I'm actually severely outdated
ah nvm, just upgraded and: