Class: ROM::Auth::Plugins::AuthenticationCredentialsPlugin::AuthenticationCredentialsMigration
- Inherits:
-
Migration
- Object
- Migration
- ROM::Auth::Plugins::AuthenticationCredentialsPlugin::AuthenticationCredentialsMigration
- Defined in:
- lib/rom/auth/plugins/authentication_credentials_plugin.rb
Instance Attribute Summary
Attributes inherited from Migration
Instance Method Summary collapse
Methods inherited from Migration
Constructor Details
This class inherits a constructor from ROM::Auth::Migration
Instance Method Details
#run ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/rom/auth/plugins/authentication_credentials_plugin.rb', line 74 def run config = self.config auth_config = system.configuration user_fk_name = auth_config.user_fk_name database.create_table(config.table_name) do foreign_key(user_fk_name, auth_config.users_table_name.to_sym) String :identifier String :type Boolean :active #add_constraint(:password_verifier_length, Sequel.function(:char_length, :password_verifier)=>64..255) String :verifier_data DateTime :confirmed_at, null: true String :confirmation_token, null: true #add_constraint(:email_confirmation_token_length) { char_length(email_confirmation_token) == config.email_confirmation_token_length } #add_constraint(:email_confirmation_token_length, Sequel.function(:char_length, :email_confirmation_token) => config.email_confirmation_token_length) #String :cookie_authentication_token, null: true #add_constraint(:cookie_authentication_token_length) { char_length(:cookie_authentication_token) == config.cookie_authentication_token_length } #add_constraint(:cookie_authentication_token_length, Sequel.function(:char_length, :cookie_authentication_token) => config.cookie_authentication_token_length) index [:identifier, :type], unique: true end end |