Files
eminuxCRM/db/migrate/20260902220000_create_api_tokens.rb
eminuxandCursor 936930e691 Espone API JSON e MCP HTTP per far lavorare gli agenti sul CRM.
Gli agenti autenticati con token Bearer possono leggere today/pipeline e annotare attività, con host MCP allineati a quelli di produzione.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-02 22:43:46 +02:00

17 lines
469 B
Ruby

class CreateApiTokens < ActiveRecord::Migration[8.1]
def change
create_table :api_tokens do |t|
t.references :user, null: false, foreign_key: true
t.string :name, null: false
t.string :token_digest, null: false
t.string :token_prefix, null: false
t.datetime :last_used_at
t.datetime :revoked_at
t.timestamps
end
add_index :api_tokens, :token_digest, unique: true
add_index :api_tokens, :revoked_at
end
end