Sha256: 018b5ae225a64568cc918465ecd39f6f5cab229bec4dd9f68710fd7b93be6761

Contents?: true

Size: 999 Bytes

Versions: 177

Compression:

Stored size: 999 Bytes

Contents

class CreatePatients < ActiveRecord::Migration[4.2]
  def change
    create_table :patients do |t|
      t.string :nhs_number
      t.string :local_patient_id, null: false
      t.string :family_name,      null: false
      t.string :given_name,       null: false
      t.date :born_on,            null: false
      t.boolean :paediatric_patient_indicator
      t.string :sex
      t.references :ethnicity
      t.string :gp_practice_code
      t.string :pct_org_code
      t.string :hospital_centre_code
      t.string :primary_esrf_centre
      t.date :died_on
      t.integer :first_cause_id
      t.integer :second_cause_id
      t.text :death_notes
      t.boolean :cc_on_all_letters, default: true
      t.date :cc_decision_on
      t.timestamps null: false
    end

    add_foreign_key :patients, :death_causes, column: :first_cause_id
    add_foreign_key :patients, :death_causes, column: :second_cause_id
    add_foreign_key :patients, :patient_ethnicities, column: :ethnicity_id
  end
end

Version data entries

177 entries across 177 versions & 1 rubygems

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