Bug #14983
open
Faking host and other models with STI in migrations doesn't work due to STI
Added by Ivan Necas almost 9 years ago.
Updated almost 9 years ago.
Description
We often use the fake classes in our migrations to avoid the issues with the real active record models when
the data are not migrated fully yet + some hooks might trigger orchestration.
This approach fails with `Host` and other STI objects, as it loads the class based on the `type` attribute
(see related issues).
We should provide a standard way how to do the data manipulations safely without risking unexpected issues.
Often the errors doesn't show immediately in isolation, but rather when multiple plugins are in place.
- Related to Bug #14982: host description migration goes throuh unfaked-host validations added
- Related to Bug #14643: Migration broken with discovered hosts added
- Subject changed from Faking host in migrations doesn't work due to STI to Faking host and other modedels with STI in migrations doesn't work due to STI
- Category set to DB migrations
- Subject changed from Faking host and other modedels with STI in migrations doesn't work due to STI to Faking host and other models with STI in migrations doesn't work due to STI
- Category deleted (
DB migrations)
- Category set to DB migrations
- Related to Bug #15038: migrate_foreman error upgrading from 6.1 to 6.2 -> error: users.helptips_enabled does not exist added
- Related to Refactor #15866: Provide alternative way of migrating data as oposed misuing db:migrate for this purpose added
- Related to Bug #21609: Migrations on clean db with rails 5 fails added
Also available in: Atom
PDF