cartodb-4.42/db/migrate/20181022133710_create_user_multifactor_auths.rb
2024-04-06 05:25:13 +00:00

22 lines
736 B
Ruby

require 'carto/db/migration_helper'
include Carto::Db::MigrationHelper
migration(
Proc.new do
create_table :user_multifactor_auths do
Uuid :id, primary_key: true, default: Sequel.lit('uuid_generate_v4()')
foreign_key :user_id, :users, type: :uuid, null: false, index: true, on_delete: :cascade
String :type, null: false
String :shared_secret, null: false
Boolean :enabled, null: false, default: false
DateTime :last_login, null: true
DateTime :created_at, null: false, default: Sequel::CURRENT_TIMESTAMP
DateTime :updated_at, null: false, default: Sequel::CURRENT_TIMESTAMP
end
end,
Proc.new do
drop_table :user_multifactor_auths
end
)