Moving to github

This commit is contained in:
2026-03-28 19:24:29 -04:00
commit 036fa7ab33
302 changed files with 17838 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
class CreateApiTokens < ActiveRecord::Migration[8.1]
def change
create_table :api_tokens do |t|
t.references :user, null: false, foreign_key: true, index: true
t.string :token, null: false
t.string :name
t.datetime :last_used_at
t.datetime :expires_at
t.timestamps
end
add_index :api_tokens, :token, unique: true
# Enable Row Level Security
execute <<-SQL
ALTER TABLE api_tokens ENABLE ROW LEVEL SECURITY;
CREATE POLICY api_tokens_isolation_policy ON api_tokens
USING (user_id = current_setting('app.current_user_id', true)::bigint);
SQL
end
end