Skip to content

Commit

Permalink
Merge pull request #8101 from lpichler/remove_sti_from_stubs
Browse files Browse the repository at this point in the history
Remove :_type_disabled for models in migrations, where type column doesn't exist #2
  • Loading branch information
chessbyte committed Apr 19, 2016
2 parents 84cc5f6 + 480161b commit 242b1b5
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
class MigrateSecurityProtocolAtributeToEndpoints < ActiveRecord::Migration[5.0]
class Endpoint < ActiveRecord::Base
self.inheritance_column = :_type_disabled # disable STI
end
class Endpoint < ActiveRecord::Base; end

class ExtManagementSystem < ActiveRecord::Base
self.inheritance_column = :_type_disabled # disable STI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class CloudSubnet < ActiveRecord::Base

class CloudSubnetNetworkPort < ActiveRecord::Base
self.table_name = "cloud_subnets_network_ports"
self.inheritance_column = :_type_disabled
end

def up
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class RemoveMiqServerProductUpdateJoinTable < ActiveRecord::Migration[5.0]
class SettingsChange < ActiveRecord::Base
self.inheritance_column = :_type_disabled # disable STI
serialize :value
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class RemoveConfigurationsFromReplicationExcludes < ActiveRecord::Migration[5.0]
class SettingsChange < ActiveRecord::Base
self.inheritance_column = :_type_disabled
serialize :value
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ class AddIdPrimaryKeyToJoinTables < ActiveRecord::Migration[5.0]
"storages_vms_and_templates" => "storage_id, vm_or_template_id"
}.freeze

class MiqRegion < ApplicationRecord
self.inheritance_column = :_type_disabled
end
class MiqRegion < ActiveRecord::Base; end

def up
say_with_time("Removing composite primary keys from join tables") do
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20160413202128_sti_configuration_script.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class StiConfigurationScript < ActiveRecord::Migration[5.0]
class ConfigurationScript < ApplicationRecord
class ConfigurationScript < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end

Expand Down

0 comments on commit 242b1b5

Please sign in to comment.