Sha256: f3f0757ff5f35a6570b6a6101c732250d6d108ad8bd43661cd017d8805fdf474
Contents?: true
Size: 641 Bytes
Versions: 16
Compression:
Stored size: 641 Bytes
Contents
class RemoveUuid < ActiveRecord::Migration @@uuid_configured = false def self.up [ :users, :accounts, :campaigns, :leads, :contacts, :opportunities, :tasks ].each do |table| remove_column table, :uuid if self.uuid_configured? execute("DROP TRIGGER IF EXISTS #{table}_uuid") end end end def self.down raise ActiveRecord::IrreversibleMigration, "Can't recover deleted UUIDs" end private def self.uuid_configured? return @@uuid_configured if @@uuid_configured config = ActiveRecord::Base.connection.instance_variable_get("@config") @@uuid_configured = config[:uuid] end end
Version data entries
16 entries across 16 versions & 1 rubygems