chore: update migration
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_access_tokens_on_owner_and_scope (owner_type,owner_id,scope) UNIQUE
|
||||
# index_access_tokens_on_owner_type_and_owner_id (owner_type,owner_id)
|
||||
# index_access_tokens_on_token (token) UNIQUE
|
||||
#
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
class AddScopeToAccessTokens < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :access_tokens, :scope, :string, default: 'full', null: false
|
||||
add_index :access_tokens, [:owner_type, :owner_id, :scope],
|
||||
unique: true,
|
||||
name: 'index_access_tokens_on_owner_and_scope'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -25,6 +25,7 @@ ActiveRecord::Schema[7.1].define(version: 2026_05_20_073722) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "scope", default: "full", null: false
|
||||
t.index ["owner_type", "owner_id", "scope"], name: "index_access_tokens_on_owner_and_scope", unique: true
|
||||
t.index ["owner_type", "owner_id"], name: "index_access_tokens_on_owner_type_and_owner_id"
|
||||
t.index ["token"], name: "index_access_tokens_on_token", unique: true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user