Sha256: 9561301bb647e3b6117877bf4598daeebb8d1f268673dce5eaeef09d1d589bcb

Contents?: true

Size: 464 Bytes

Versions: 22

Compression:

Stored size: 464 Bytes

Contents

class AssignMissingUuidsForLocalAccounts < ActiveRecord::Migration[4.2]
  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

22 entries across 22 versions & 1 rubygems

Version Path
openstax_accounts-9.9.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.8.1 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.8.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.7.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.6.1 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.6.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.5.1 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.5.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.4.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.3.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.0.5 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.0.4 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.2.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.0.3 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.1.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.0.2 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.0.1 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-9.0.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-8.1.1 db/migrate/10_assign_missing_uuids_for_local_accounts.rb
openstax_accounts-8.1.0 db/migrate/10_assign_missing_uuids_for_local_accounts.rb