chore: update migration

This commit is contained in:
Shivam Mishra
2026-05-20 17:47:26 +05:30
parent 7c73981ddd
commit b0aa51e811
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -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
+1
View File
@@ -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