Sha256: 029009827e9a4b9e1d6cd67aaf88ff4b8a9c9d5f87b441b37642bed52035e095

Contents?: true

Size: 607 Bytes

Versions: 10

Compression:

Stored size: 607 Bytes

Contents

class SetPatientsSecureId < ActiveRecord::Migration[5.1]
  def change
    remove_column :patients, :secure_id, :string
    add_column :patients, :secure_id, :uuid, default: 'uuid_generate_v4()', null: false
    add_index :patients, :secure_id, using: :btree, unique: true

    reversible do |direction|
      direction.up do
        ActiveRecord::Base.connection.execute(
          "DROP FUNCTION IF EXISTS generate_secure_id(integer); \
           DROP FUNCTION IF EXISTS generate_patient_secure_id();"
        )
      end
      # down (reinstating the 2 functions) is not implemented...
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc8 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.rc7 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.rc6 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.rc5 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.rc4 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.rc3 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.rc1 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.beta12 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.beta11 db/migrate/20171013145849_set_patients_secure_id.rb
renalware-core-2.0.0.pre.beta10 db/migrate/20171013145849_set_patients_secure_id.rb