Sha256: 1bc6c37e9e081624578098203829af0dbb146f8eccbaa2260797077a6d57a674

Contents?: true

Size: 650 Bytes

Versions: 98

Compression:

Stored size: 650 Bytes

Contents

class AddPkToDrugTypesDrugs < ActiveRecord::Migration[5.1]
  def change
    within_renalware_schema do
      # Remove the old PK
      reversible do |direction|
        direction.up do
          execute "ALTER TABLE drug_types_drugs DROP CONSTRAINT IF EXISTS drug_types_drugs_pkey"
        end
        direction.down do
          # noop
          # ok was on drug_type_id, which is incorrect (duplicates will be found) so leaving
        end
      end
      add_column :drug_types_drugs, :id, :primary_key
      add_index :drug_types_drugs, [:drug_id, :drug_type_id], unique: true
      add_timestamps :drug_types_drugs, null: true
    end
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
renalware-core-2.1.1 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.1.0 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.167 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.166 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.165 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.164 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.163 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.162 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.161 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.160 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.159 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.158 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.157 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.156 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.155 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.153 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.152 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.151 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.149 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.148 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb