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 over 8 years ago. Updated over 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 #1

Updated by Ivan Necas over 8 years ago

  • Related to Bug #14982: host description migration goes throuh unfaked-host validations added
Actions #2

Updated by Ivan Necas over 8 years ago

  • Related to Bug #14643: Migration broken with discovered hosts added
Actions #3

Updated by Ivan Necas over 8 years ago

  • 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
Actions #4

Updated by Dominic Cleal over 8 years ago

  • Category set to DB migrations
Actions #5

Updated by Ivan Necas over 8 years ago

  • 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)
Actions #6

Updated by Dominic Cleal over 8 years ago

  • Category set to DB migrations
Actions #7

Updated by Ivan Necas over 8 years ago

  • Related to Bug #15038: migrate_foreman error upgrading from 6.1 to 6.2 -> error: users.helptips_enabled does not exist added
Actions #8

Updated by Ivan Necas over 8 years ago

  • Related to Refactor #15866: Provide alternative way of migrating data as oposed misuing db:migrate for this purpose added
Actions #9

Updated by Ori Rabin about 7 years ago

  • Related to Bug #21609: Migrations on clean db with rails 5 fails added
Actions

Also available in: Atom PDF