-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove :_type_disabled for models in migrations, where type column doesn't exist #7354
Remove :_type_disabled for models in migrations, where type column doesn't exist #7354
Conversation
c72967f
to
64629cb
Compare
class OperatingSystemFlavor < ActiveRecord::Base | ||
self.inheritance_column = :_type_disabled | ||
end | ||
class OperatingSystemFlavor < ActiveRecord::Base; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really surprised on this one :)
@lpichler So does your script there check based on the latest tables, or what the state of the tables are at that time. |
…e column doesn't exist
64629cb
to
64af459
Compare
@Fryguy no but now yes, I updated it in way that it based on state of tables at that time. I also removed |
Checked commit lpichler@64af459 with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 |
end | ||
|
||
class FileDepot < ActiveRecord::Base | ||
self.inheritance_column = :_type_disabled # disable STI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to keep this for now...
The migration on the following day adds a type column:
db/migrate/20140410132430_subclass_file_depot_by_protocol.rb- def up
db/migrate/20140410132430_subclass_file_depot_by_protocol.rb: add_column :file_depots, :type, :string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but when was this migration created the column was not here, so should I respect state of DB in that time or state of latest DB ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpichler When this migration was created, it would have been possible to run these migrations out of order if you were the author of the other migration. Since we're long past this, I think it's fine to drop this as you have done... 👍
related #6739
based on comments:
#5554 (comment) or #6739 (comment)
this script helpded me:
cc @Fryguy @jrafanie