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.0.104 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.103 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.102 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.101 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.100 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.99 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.98 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.97 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.96 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.95 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.94 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.93 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.92 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.91 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.90 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.89 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.88 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.87 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.86 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb
renalware-core-2.0.85 db/migrate/20171123143534_add_pk_to_drug_types_drugs.rb