Sha256: 67b69f01a2dc0c7b8ecddf3928d595ee95d05beda01e48fcdda0d02193e0fd12

Contents?: true

Size: 707 Bytes

Versions: 171

Compression:

Stored size: 707 Bytes

Contents

class AddIndexesToDiarySlots < ActiveRecord::Migration[5.1]
  def change
    # This unique index ensures that, for a diary (weekly or master), the same patient can
    # only be added to one station in any period (am pm etc) on any day of the week
    add_index :hd_diary_slots,
              [
                :diary_id,
                :diurnal_period_code_id,
                :day_of_week,
                :patient_id
              ],
              unique: true,
              name: "idx_unique_diaryslot_patients"

    add_column :hd_diary_slots, :archived, :boolean, null: false, default: false
    add_index :hd_diary_slots, :archived
    add_column :hd_diary_slots, :archived_at, :datetime
  end
end

Version data entries

171 entries across 171 versions & 1 rubygems

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