Sha256: 2ff246eb10039c3bd9f27ed740d24f5864ff17b0041782fc51d0854364b0899c

Contents?: true

Size: 971 Bytes

Versions: 177

Compression:

Stored size: 971 Bytes

Contents

class MoveDoctorsTablesToPatientsNamespace < ActiveRecord::Migration[4.2]
  def change
    rename_table :doctor_doctors, :patient_primary_care_physicians
    rename_table :doctor_practices, :patient_practices
    rename_table :doctor_doctors_practices, :patient_practices_primary_care_physicians

    rename_column :patient_practices_primary_care_physicians, :doctor_id, :primary_care_physician_id

    add_index(:patient_practices_primary_care_physicians, :practice_id)
    # Uncommented these 2 indexes as schema:load complains it is a duplicate
    # add_foreign_key :patient_practices_primary_care_physicians, :patient_primary_care_physicians, column: :primary_care_physician_id
    # add_foreign_key :patient_practices_primary_care_physicians, :patient_practices, column: :practice_id

    rename_column :patients, :doctor_id, :primary_care_physician_id
    # add_foreign_key :patients, :patient_primary_care_physicians, column: :primary_care_physician_id
  end
end

Version data entries

177 entries across 177 versions & 1 rubygems

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