Sha256: ff23d8ce9ceba397c40ae3938535a6d81161496b78f157d8c1e4cbcbbb70bc31

Contents?: true

Size: 829 Bytes

Versions: 98

Compression:

Stored size: 829 Bytes

Contents

# The pathology_current_observation_sets table has a values hash (jsonb)
# of the most recent pathology.
#
# You can refresh the content of this table with the following query:
#   select refresh_current_observation_set(id) from patients;

class CreatePathologyCurrentTable < ActiveRecord::Migration[5.1]
  def change
    within_renalware_schema do
      create_table :pathology_current_observation_sets do |t|
        t.references :patient, null: false, foreign_key: true, index: { unique: true }
        t.jsonb :values, index: { using: :gin }, default: {}

        t.datetime :created_at, null: false, default: -> { "CURRENT_TIMESTAMP" }
        t.datetime :updated_at, null: false, default: -> { "CURRENT_TIMESTAMP" }
      end

      drop_view :pathology_current_key_observation_sets, revert_to_version: 2
    end
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
renalware-core-2.0.84 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.83 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.82 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.81 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.80 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.79 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.78 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.77 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.76 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.75 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.74 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.73 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.72 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.71 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.70 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.69 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.68 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.67 db/migrate/20171211161400_create_pathology_current_table.rb