Sha256: c029bdae3fd92285001687412e2f0411c5401a271931f56f64b57b37086cd1f9

Contents?: true

Size: 588 Bytes

Versions: 63

Compression:

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

63 entries across 63 versions & 1 rubygems

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