Closed Fryguy closed 3 years ago
type
, set
self.inheritance_column = :_type_disabled
example
class CloudNetwork < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end
This issue has been automatically marked as stale because it has not been updated for at least 6 months.
If you can still reproduce this issue on the current release or on master
, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions!
@miq-bot remove_label stale
We need a note about if remove_column
appears in a PR, there needs to be a linked PR in other repos showing that those columns are no longer used.
Might wants to describe the different "hats" needed to be worn for review.
_id
or a type
column that isn't being used for STIMigrations should not create new rows if rows didn't previously exist...that is, an empty database migrated should still be empty in the end, particularly for test reasons. Data migrations of existing data can transform into new rows if necessary.
Be region-aware in data migrations. When a data migration runs in the global region, you probably only want to update records for your region (especially when the data migration is complicated). Updating records for other regions is a waste of time since the migration will be run in the remote region and it will push the changes up.
Use ActiveRecord::Base
for models in migrations.
Part of the advantage of ApplicationRecord is that we can leave AR::Base unmolested, which is exactly what migrations want: a plain ordinary AR object with no app-code-of-the-day surprises.
taken from https://github.com/ManageIQ/manageiq/pull/7312/files#r56356275