mirror of
https://github.com/penpot/penpot.git
synced 2026-03-19 00:43:52 +00:00
- makes the profile access more efficient (replace in-app joins to a simple select query on profile table - add partial support for access-tokens (still missing some RPC methods) - move router definitions to specific modules and simplify the main http module definitions to simple includes - simplifiy authentication code related to access-tokens and sessions - normalize db parameters with proper namespaced props - more work on convert all modules initialization to use proper specs with fully-qualified keyword config props
20 lines
597 B
SQL
20 lines
597 B
SQL
DROP TABLE IF EXISTS access_token;
|
|
CREATE TABLE access_token (
|
|
id uuid NOT NULL DEFAULT uuid_generate_v4() PRIMARY KEY,
|
|
profile_id uuid NOT NULL REFERENCES profile(id) ON DELETE CASCADE DEFERRABLE,
|
|
|
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
|
|
name text NOT NULL,
|
|
token text NOT NULL,
|
|
perms text[] NULL
|
|
);
|
|
|
|
ALTER TABLE access_token
|
|
ALTER COLUMN name SET STORAGE external,
|
|
ALTER COLUMN token SET STORAGE external,
|
|
ALTER COLUMN perms SET STORAGE external;
|
|
|
|
CREATE INDEX access_token__profile_id__idx ON access_token(profile_id);
|