Sha256: c445ee76f146c072838d177099af0eeed8e660def355c749b0df0fd8b180c3ff

Contents?: true

Size: 460 Bytes

Versions: 6

Compression:

Stored size: 460 Bytes

Contents

class AssignMissingUuidsForLocalAccounts < ActiveRecord::Migration
  def change
    enable_extension 'pgcrypto'

    OpenStax::Accounts::Account.where(uuid: nil).update_all('"uuid" = gen_random_uuid()')

    change_column :openstax_accounts_accounts, :uuid, :uuid, using: 'uuid::uuid',
                                                             default: 'gen_random_uuid()',
                                                             null: false
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
openstax_accounts-7.13.1 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-7.13.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-7.12.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-7.11.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-7.10.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-7.9.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb