mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 06:42:32 -05:00
add uuid to accounts
This commit is contained in:
1 parent
33466c1d07
commit
12cf28792b
3 files changed
+33
-1
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddUuidToAccounts < ActiveRecord::Migration[7.1]
|
||||
class MigrationAccount < ApplicationRecord
|
||||
self.table_name = 'accounts'
|
||||
end
|
||||
|
||||
def up
|
||||
add_column :accounts, :uuid, :string
|
||||
|
||||
MigrationAccount.all.each do |account|
|
||||
account.update_columns(uuid: SecureRandom.uuid)
|
||||
end
|
||||
|
||||
add_index :accounts, :uuid, unique: true
|
||||
|
||||
change_column_null :accounts, :uuid, false
|
||||
end
|
||||
|
||||
def down
|
||||
drop_column :account, :uuid
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user