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 )