Sha256: 86b1fa2e2d2f75f5e52ac300dd4ac2c93697e9fe4f6139e0e6ece116126334c3

Contents?: true

Size: 1013 Bytes

Versions: 15

Compression:

Stored size: 1013 Bytes

Contents

class AddNresultToPathologyObservations < ActiveRecord::Migration[5.2]
  def change
    within_renalware_schema do
      add_column(
        :pathology_observations,
        :nresult,
        :float,
        index: false,
        null: true,
        comment: "The result column cast to a float, for ease of using graphing and claculations."\
                 "Will be null if the result has a text value that cannot be coreced into a number"
      )

      reversible do |direction|
        direction.up do
          load_function("update_pathology_observations_nresult_from_trigger_v01.sql")
          load_trigger("update_pathology_observations_nresult_trigger_v01.sql")
        end
        direction.down do
          connection.execute(
            "DROP TRIGGER IF EXISTS update_pathology_observations_nresult_trigger "\
            "ON pathology_observations; "\
            "DROP FUNCTION IF EXISTS update_pathology_observations_nresult_from_trigger();"
          )
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.1.1 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.1.0 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.167 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.166 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.165 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.164 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.163 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.162 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.161 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.160 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.159 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.158 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.157 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.156 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb
renalware-core-2.0.155 db/migrate/20200626090256_add_nresult_to_pathology_observations.rb