lib/generators/roda/oauth/templates/db/migrate/create_rodauth_oauth.rb in rodauth-oauth-0.0.1 vs lib/generators/roda/oauth/templates/db/migrate/create_rodauth_oauth.rb in rodauth-oauth-0.0.2
- old
+ new
@@ -22,10 +22,16 @@
t.datetime :expires_in, null: false
t.string :redirect_uri
t.datetime :revoked_at
t.string :scopes, null: false
t.datetime :created_at, null: false, default: -> { "CURRENT_TIMESTAMP" }
+ # for using access_types
+ t.string :access_type, null: false, default: "offline"
+ # uncomment to enable PKCE
+ # t.string :code_challenge
+ # t.string :code_challenge_method
+
t.index(%i[oauth_application_id code], unique: true)
end
create_table :oauth_tokens do |t|
t.integer :account_id
@@ -35,10 +41,16 @@
t.integer :oauth_token_id
t.foreign_key :oauth_tokens, column: :oauth_token_id
t.integer :oauth_application_id
t.foreign_key :oauth_applications, column: :oauth_application_id
t.string :token, null: false, token: true
+ # uncomment if setting oauth_tokens_token_hash_column
+ # and delete the token column
+ # t.string :token_hash, token: true
t.string :refresh_token
+ # uncomment if setting oauth_tokens_refresh_token_hash_column
+ # and delete the refresh_token column
+ # t.string :refresh_token_hash, token: true
t.datetime :expires_in, null: false
t.datetime :revoked_at
t.string :scopes, null: false
t.datetime :created_at, null: false, default: -> { "CURRENT_TIMESTAMP" }
end
\ No newline at end of file