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 ```
Solution:
Did you run mix ash.codegen to generate migrations?
Jump to solution
6 Replies
Solution
ZachDaniel
ZachDaniel•4mo ago
Did you run mix ash.codegen to generate migrations?
Quentin
QuentinOP•4mo ago
@Zach Daniel oddly enough, running the command manually (with --dev) actually worked. I usually press the button in the UI.
ZachDaniel
ZachDaniel•4mo ago
Ah, interesting 🤔 Are you on the latest version of ash_phoenix? actually it might be all the packages
Quentin
QuentinOP•4mo ago
{:ash_phoenix, "~> 2.0"}
ZachDaniel
ZachDaniel•4mo ago
there was a case where the task wouldn't be reenabled so would only work once
Quentin
QuentinOP•4mo ago
waw I'm actually severely outdated ah nvm, just upgraded and:
Upgraded:
ash 3.5.20 => 3.5.22
ash_admin 0.13.9 => 0.13.10
ash_authentication 4.9.0 => 4.9.3
ash_authentication_phoenix 2.9.0 => 2.10.1
ash_phoenix 2.3.6 => 2.3.7
ash_postgres 2.6.7 => 2.6.8
ash_sql 0.2.80 => 0.2.82
ecto 3.12.6 => 3.13.0
ecto_sql 3.12.1 => 3.13.0
reactor 0.15.4 => 0.15.5
spark 2.2.65 => 2.2.66
Upgraded:
ash 3.5.20 => 3.5.22
ash_admin 0.13.9 => 0.13.10
ash_authentication 4.9.0 => 4.9.3
ash_authentication_phoenix 2.9.0 => 2.10.1
ash_phoenix 2.3.6 => 2.3.7
ash_postgres 2.6.7 => 2.6.8
ash_sql 0.2.80 => 0.2.82
ecto 3.12.6 => 3.13.0
ecto_sql 3.12.1 => 3.13.0
reactor 0.15.4 => 0.15.5
spark 2.2.65 => 2.2.66

Did you find this page helpful?