mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Follow-up to a full re-audit of the 2.0 tree. Most prior findings were already fixed; this closes the ones that were not: - SAML assertion replay: validateInResponseTo ifPresent plus a Redis-backed CacheProvider, so a captured signed assertion cannot be replayed. ifPresent keeps IdP-initiated SSO working. - MFA login challenge burned after 5 wrong TOTP codes. - api_keys.key_prefix indexed; the per-request lookup was a full table scan. - MAX_AI_JOBS_PER_USER caps a user's in-flight single-file AI jobs (the AI pool runs at concurrency 1). Batch and pipeline AI stay uncapped. - MAX_WORKSPACE_SIZE_GB enforced instead of being dead config. - SUBPROCESS_MEMORY_LIMIT_MB (default off) for the native media and doc engines; not applied to the AI sidecar. - SVG sanitizer closes unquoted and whitespace-prefixed javascript: hrefs and the animateTransform/animateMotion/handler/mpath elements. - Windows-style paths stripped from error output to match the Sentry scrubber. - Postgres and Redis compose services get cap_drop plus pids_limit and cpus. - .env.example ships MAX_SVG_SIZE_MB=50 (0 disabled the cap). Adds security-focused unit and integration tests. typecheck, biome, and the full unit and integration suites pass.
993 lines
25 KiB
JSON
993 lines
25 KiB
JSON
{
|
|
"id": "5634b76b-9b83-4a81-9307-bebc895cbf65",
|
|
"prevId": "9e790b1b-8a07-4885-b3d9-3d3f81d0d4e8",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.api_keys": {
|
|
"name": "api_keys",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"key_hash": {
|
|
"name": "key_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"key_prefix": {
|
|
"name": "key_prefix",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'Default API Key'"
|
|
},
|
|
"permissions": {
|
|
"name": "permissions",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"last_used_at": {
|
|
"name": "last_used_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"api_keys_key_prefix_idx": {
|
|
"name": "api_keys_key_prefix_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "key_prefix",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"api_keys_user_id_users_id_fk": {
|
|
"name": "api_keys_user_id_users_id_fk",
|
|
"tableFrom": "api_keys",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["user_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.audit_log": {
|
|
"name": "audit_log",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"actor_id": {
|
|
"name": "actor_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"actor_username": {
|
|
"name": "actor_username",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"action": {
|
|
"name": "action",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_type": {
|
|
"name": "target_type",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"target_id": {
|
|
"name": "target_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"details": {
|
|
"name": "details",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"integrity": {
|
|
"name": "integrity",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"request_id": {
|
|
"name": "request_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {
|
|
"audit_log_created_at_idx": {
|
|
"name": "audit_log_created_at_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"audit_log_action_idx": {
|
|
"name": "audit_log_action_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "action",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"audit_log_actor_id_idx": {
|
|
"name": "audit_log_actor_id_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "actor_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"audit_log_actor_id_users_id_fk": {
|
|
"name": "audit_log_actor_id_users_id_fk",
|
|
"tableFrom": "audit_log",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["actor_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.jobs": {
|
|
"name": "jobs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tool_id": {
|
|
"name": "tool_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"pool": {
|
|
"name": "pool",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "job_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'queued'"
|
|
},
|
|
"attempts": {
|
|
"name": "attempts",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"progress": {
|
|
"name": "progress",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"input_refs": {
|
|
"name": "input_refs",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"output_refs": {
|
|
"name": "output_refs",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"settings": {
|
|
"name": "settings",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"error": {
|
|
"name": "error",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"bytes_in": {
|
|
"name": "bytes_in",
|
|
"type": "bigint",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"bytes_out": {
|
|
"name": "bytes_out",
|
|
"type": "bigint",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"duration_ms": {
|
|
"name": "duration_ms",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"started_at": {
|
|
"name": "started_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"completed_at": {
|
|
"name": "completed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"delete_after": {
|
|
"name": "delete_after",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {
|
|
"jobs_created_at_idx": {
|
|
"name": "jobs_created_at_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"jobs_status_idx": {
|
|
"name": "jobs_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"jobs_user_id_users_id_fk": {
|
|
"name": "jobs_user_id_users_id_fk",
|
|
"tableFrom": "jobs",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["user_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.pipelines": {
|
|
"name": "pipelines",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"steps": {
|
|
"name": "steps",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"pipelines_user_id_users_id_fk": {
|
|
"name": "pipelines_user_id_users_id_fk",
|
|
"tableFrom": "pipelines",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["user_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.roles": {
|
|
"name": "roles",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"permissions": {
|
|
"name": "permissions",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"tool_permissions": {
|
|
"name": "tool_permissions",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"is_builtin": {
|
|
"name": "is_builtin",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_by": {
|
|
"name": "created_by",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"roles_created_by_users_id_fk": {
|
|
"name": "roles_created_by_users_id_fk",
|
|
"tableFrom": "roles",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["created_by"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"roles_name_unique": {
|
|
"name": "roles_name_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": ["name"]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.sessions": {
|
|
"name": "sessions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"id_token": {
|
|
"name": "id_token",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"last_activity": {
|
|
"name": "last_activity",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"sessions_user_id_users_id_fk": {
|
|
"name": "sessions_user_id_users_id_fk",
|
|
"tableFrom": "sessions",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["user_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.settings": {
|
|
"name": "settings",
|
|
"schema": "",
|
|
"columns": {
|
|
"key": {
|
|
"name": "key",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.teams": {
|
|
"name": "teams",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"legal_hold": {
|
|
"name": "legal_hold",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"storage_quota": {
|
|
"name": "storage_quota",
|
|
"type": "bigint",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"retention_hours": {
|
|
"name": "retention_hours",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"teams_name_unique": {
|
|
"name": "teams_name_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": ["name"]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.user_files": {
|
|
"name": "user_files",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"original_name": {
|
|
"name": "original_name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"stored_name": {
|
|
"name": "stored_name",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"mime_type": {
|
|
"name": "mime_type",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"size": {
|
|
"name": "size",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"width": {
|
|
"name": "width",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"height": {
|
|
"name": "height",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"version": {
|
|
"name": "version",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 1
|
|
},
|
|
"parent_id": {
|
|
"name": "parent_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"tool_chain": {
|
|
"name": "tool_chain",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"user_files_user_id_users_id_fk": {
|
|
"name": "user_files_user_id_users_id_fk",
|
|
"tableFrom": "user_files",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["user_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.user_preferences": {
|
|
"name": "user_preferences",
|
|
"schema": "",
|
|
"columns": {
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"key": {
|
|
"name": "key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"value": {
|
|
"name": "value",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {
|
|
"user_preferences_user_id_users_id_fk": {
|
|
"name": "user_preferences_user_id_users_id_fk",
|
|
"tableFrom": "user_preferences",
|
|
"tableTo": "users",
|
|
"columnsFrom": ["user_id"],
|
|
"columnsTo": ["id"],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"user_preferences_user_id_key_pk": {
|
|
"name": "user_preferences_user_id_key_pk",
|
|
"columns": ["user_id", "key"]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "text",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"username": {
|
|
"name": "username",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'user'"
|
|
},
|
|
"team": {
|
|
"name": "team",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'Default'"
|
|
},
|
|
"must_change_password": {
|
|
"name": "must_change_password",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": true
|
|
},
|
|
"auth_provider": {
|
|
"name": "auth_provider",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'local'"
|
|
},
|
|
"external_id": {
|
|
"name": "external_id",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"legal_hold": {
|
|
"name": "legal_hold",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"storage_used": {
|
|
"name": "storage_used",
|
|
"type": "bigint",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"storage_quota": {
|
|
"name": "storage_quota",
|
|
"type": "bigint",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"totp_secret": {
|
|
"name": "totp_secret",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"totp_enabled": {
|
|
"name": "totp_enabled",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"recovery_codes_hash": {
|
|
"name": "recovery_codes_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
}
|
|
},
|
|
"indexes": {},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {
|
|
"users_username_unique": {
|
|
"name": "users_username_unique",
|
|
"nullsNotDistinct": false,
|
|
"columns": ["username"]
|
|
}
|
|
},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.job_status": {
|
|
"name": "job_status",
|
|
"schema": "public",
|
|
"values": ["queued", "processing", "completed", "failed", "canceled"]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
}
|