Comments (10)
- when you are working with the model in data migration, define the model in the migration
- when there is model defined in your migration and it has column
type
, set
self.inheritance_column = :_type_disabled
example
class CloudNetwork < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end
from manageiq-schema.
- don't mix data and structural migration to the one migration, create separate migrations
from manageiq-schema.
- Describe the "why" behind having the rule that we don't use default, null, foreign keys, etc.
from manageiq-schema.
- Explain the pitfalls of deserializing columns that might have serialized objects in them. In particular, MiqExpression, which is common, and describe avoiding desrialization and using a LIKE query can be used instead.
- Describe the benefits of update_all
- Describe batching and when it's possible to use a reentrant migration for LARGE data migrations.
from manageiq-schema.
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!
from manageiq-schema.
@miq-bot remove_label stale
from manageiq-schema.
-
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.
- DBA - review for database schema issues that could lead to performance/inefficiency problems, as well as index selection
- Rails - review for Rails-invalid column names such as non-foreign-keys that end in
_id
or atype
column that isn't being used for STI - ManageIQ - review for understanding where the new tables fits in the grand scheme and what use cases it is supporting. For providers, it's important to understand if the new tables and the naming of things fits into the single pane of glass, and how those new tables would be reused by other provider of the same provider type.
from manageiq-schema.
Migrations 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.
from manageiq-schema.
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.
from manageiq-schema.
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
from manageiq-schema.
Related Issues (20)
- Add a spec that verifies that stub models have inheritance check HOT 2
- Interrupting migration during 20150806211453 leaves DB un-migratable HOT 3
- Add unique index to tags and/or classifications table HOT 8
- remove CINDER storage object HOT 9
- Unique index on security_groups_vms HOT 2
- db:seed tries to touch a non-existent arbitration_settings table HOT 3
- [V2V] Create conversion hosts for appropriately tagged vms HOT 4
- Database migration fails with unknown migration version 5.1 HOT 1
- Missing migrations for hawkular removal HOT 6
- Migration has a too long of name HOT 4
- Avoid using hardcoded number literals for ids in specs HOT 4
- Remove the RedHat Automate domain.
- Missing benchmark timing around 'Seeding :schema_migrations_ran table' HOT 3
- The `rails generate migration` command should also generate a spec file HOT 5
- Update collapsed initial migration
- Displaying notifications causes ActiveRecord::Attribute error HOT 6
- [RFE] Speed up `rake test:vmdb:setup` HOT 14
- Custom tables break db:migrate HOT 5
- Change rake tasks so that rake spec does everything HOT 2
- Refetching the shallow clone fails on occasion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manageiq-schema.