Sha256: 9fe6a9cc580dfe23897223880fa4b30883170f8b44b1f22f56f8ccdbb8dd9e4d
Contents?: true
Size: 633 Bytes
Versions: 98
Compression:
Stored size: 633 Bytes
Contents
class CreateHospitalWards < ActiveRecord::Migration[5.1] def change within_renalware_schema do create_table :hospital_wards do |t| t.string :name, null: false t.references :hospital_unit, index: true, foreign_key: true, null: false t.datetime :deleted_at t.timestamps null: false end # This create a postgres partial index # Name must be unique in for any unit, but only amongst un-deleted wards. add_index :hospital_wards, [:name, :hospital_unit_id], unique: true, where: "deleted_at IS NOT NULL" end end end
Version data entries
98 entries across 98 versions & 1 rubygems