Project

General

Profile

Actions

Bug #14983

open

Faking host and other models with STI in migrations doesn't work due to STI

Added by Ivan Necas about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 issues 5 (2 open3 closed)

Related to Katello - Bug #14982: host description migration goes throuh unfaked-host validationsClosedIvan Necas05/10/2016Actions
Related to Discovery - Bug #14643: Migration broken with discovered hostsClosedLukas Zapletal04/14/2016Actions
Related to Foreman - Bug #15038: migrate_foreman error upgrading from 6.1 to 6.2 -> error: users.helptips_enabled does not existClosedBrad Buckingham05/12/2016Actions
Related to Foreman - Refactor #15866: Provide alternative way of migrating data as oposed misuing db:migrate for this purposeNew07/27/2016Actions
Related to Discovery - Bug #21609: Migrations on clean db with rails 5 failsNew11/09/2017Actions
Actions

Also available in: Atom PDF