Sha256: 860adac78932f5b8d4e158181fecc29f97b48f06cfe7d59e92e51f41c0faa368

Contents?: true

Size: 776 Bytes

Versions: 69

Compression:

Stored size: 776 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
    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

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
renalware-core-2.0.64 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.63 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.62 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.61 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.60 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.58 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.57 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.56 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.55 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.54 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.53 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.52 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.51 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.50 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.48 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.47 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.46 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.45 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.44 db/migrate/20171211161400_create_pathology_current_table.rb
renalware-core-2.0.43 db/migrate/20171211161400_create_pathology_current_table.rb