Actions
Bug #34994
closed"ERROR: relation "application_records" does not exist" when using models inside migrations
Description
The changes from #34305 made `ApplicationRecord` not being loaded early enough to properly work inside of DB migrations that rely on real models (vs fake ones as often used in core)
example failure from the installation:
2022-05-27 22:14:48 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: PG::UndefinedTable: ERROR: relation "application_records" does not exist 2022-05-27 22:14:48 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: LINE 1: DELETE FROM "application_records" WHERE "application_records... 2022-05-27 22:14:48 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: ^ 2022-05-27 22:14:48 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /usr/share/gems/gems/activerecord-6.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in `async_exec_params' … 2022-05-27 22:14:48 [INFO ] [configure] /Stage[main]/Foreman::Database/Foreman::Rake[db:migrate]/Exec[foreman-rake-db:migrate]/returns: /usr/share/gems/gems/foreman_puppet-4.0.0/db/migrate_foreman/20161205142618_delete_orphaned_smart_class_parameters.foreman_puppet.rb:4:in `up'
Updated by Evgeni Golov over 2 years ago
- Related to Refactor #34305: Stop creating settings in the DB added
Updated by The Foreman Bot over 2 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/9244 added
Updated by Evgeni Golov over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|707d7fff363b16f23aebfd1e5c688a26978c2092.
Actions