3854 lines
100 KiB
JSON
3854 lines
100 KiB
JSON
{
|
|
"id": "afc084f4-1d7f-4c41-b31c-d6a3d738ef18",
|
|
"prevId": "21f5a9cd-de25-45d1-8620-3d133d3d161d",
|
|
"version": "7",
|
|
"dialect": "postgresql",
|
|
"tables": {
|
|
"public.account_action_tokens": {
|
|
"name": "account_action_tokens",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "account_token_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token_hash": {
|
|
"name": "token_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"consumed_at": {
|
|
"name": "consumed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"account_action_tokens_hash_unique": {
|
|
"name": "account_action_tokens_hash_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "token_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"account_action_tokens_user_type_idx": {
|
|
"name": "account_action_tokens_user_type_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"account_action_tokens_expiry_idx": {
|
|
"name": "account_action_tokens_expiry_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "expires_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"account_action_tokens_user_id_users_id_fk": {
|
|
"name": "account_action_tokens_user_id_users_id_fk",
|
|
"tableFrom": "account_action_tokens",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.asset_versions": {
|
|
"name": "asset_versions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"asset_id": {
|
|
"name": "asset_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"version": {
|
|
"name": "version",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"storage_key": {
|
|
"name": "storage_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"thumbnail_key": {
|
|
"name": "thumbnail_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"mime_type": {
|
|
"name": "mime_type",
|
|
"type": "varchar(120)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"byte_size": {
|
|
"name": "byte_size",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"width": {
|
|
"name": "width",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"height": {
|
|
"name": "height",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"duration_ms": {
|
|
"name": "duration_ms",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"prompt": {
|
|
"name": "prompt",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"negative_prompt": {
|
|
"name": "negative_prompt",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"provider_model": {
|
|
"name": "provider_model",
|
|
"type": "varchar(160)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"seed": {
|
|
"name": "seed",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"generation_params": {
|
|
"name": "generation_params",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"is_current": {
|
|
"name": "is_current",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"asset_versions_asset_version_unique": {
|
|
"name": "asset_versions_asset_version_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "asset_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "version",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"asset_versions_current_idx": {
|
|
"name": "asset_versions_current_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "asset_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "is_current",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"asset_versions_asset_id_assets_id_fk": {
|
|
"name": "asset_versions_asset_id_assets_id_fk",
|
|
"tableFrom": "asset_versions",
|
|
"tableTo": "assets",
|
|
"columnsFrom": [
|
|
"asset_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"asset_versions_created_by_id_users_id_fk": {
|
|
"name": "asset_versions_created_by_id_users_id_fk",
|
|
"tableFrom": "asset_versions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.assets": {
|
|
"name": "assets",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"project_id": {
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "asset_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(180)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "asset_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'DRAFT'"
|
|
},
|
|
"tags": {
|
|
"name": "tags",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'[]'::jsonb"
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"assets_project_type_idx": {
|
|
"name": "assets_project_type_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "project_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"assets_project_status_idx": {
|
|
"name": "assets_project_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "project_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"assets_project_id_projects_id_fk": {
|
|
"name": "assets_project_id_projects_id_fk",
|
|
"tableFrom": "assets",
|
|
"tableTo": "projects",
|
|
"columnsFrom": [
|
|
"project_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"assets_created_by_id_users_id_fk": {
|
|
"name": "assets_created_by_id_users_id_fk",
|
|
"tableFrom": "assets",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.audit_logs": {
|
|
"name": "audit_logs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"actor_id": {
|
|
"name": "actor_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"action": {
|
|
"name": "action",
|
|
"type": "varchar(120)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"resource_type": {
|
|
"name": "resource_type",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"resource_id": {
|
|
"name": "resource_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_agent": {
|
|
"name": "user_agent",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"before": {
|
|
"name": "before",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"after": {
|
|
"name": "after",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"audit_logs_workspace_time_idx": {
|
|
"name": "audit_logs_workspace_time_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"audit_logs_actor_idx": {
|
|
"name": "audit_logs_actor_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "actor_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"audit_logs_workspace_id_workspaces_id_fk": {
|
|
"name": "audit_logs_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"audit_logs_actor_id_users_id_fk": {
|
|
"name": "audit_logs_actor_id_users_id_fk",
|
|
"tableFrom": "audit_logs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"actor_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.billing_subscriptions": {
|
|
"name": "billing_subscriptions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'stripe'"
|
|
},
|
|
"customer_id": {
|
|
"name": "customer_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"subscription_id": {
|
|
"name": "subscription_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"price_id": {
|
|
"name": "price_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"plan": {
|
|
"name": "plan",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "varchar(48)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'no_subscription'"
|
|
},
|
|
"current_period_end": {
|
|
"name": "current_period_end",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"cancel_at_period_end": {
|
|
"name": "cancel_at_period_end",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"last_event_created_at": {
|
|
"name": "last_event_created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"billing_subscriptions_workspace_unique": {
|
|
"name": "billing_subscriptions_workspace_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"billing_subscriptions_customer_unique": {
|
|
"name": "billing_subscriptions_customer_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "customer_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"billing_subscriptions_subscription_unique": {
|
|
"name": "billing_subscriptions_subscription_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "subscription_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"billing_subscriptions_status_idx": {
|
|
"name": "billing_subscriptions_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"billing_subscriptions_workspace_id_workspaces_id_fk": {
|
|
"name": "billing_subscriptions_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "billing_subscriptions",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.billing_webhook_events": {
|
|
"name": "billing_webhook_events",
|
|
"schema": "",
|
|
"columns": {
|
|
"event_id": {
|
|
"name": "event_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": true,
|
|
"notNull": true
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'stripe'"
|
|
},
|
|
"event_type": {
|
|
"name": "event_type",
|
|
"type": "varchar(160)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"livemode": {
|
|
"name": "livemode",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"provider_created_at": {
|
|
"name": "provider_created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"processed_at": {
|
|
"name": "processed_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"billing_webhook_events_workspace_idx": {
|
|
"name": "billing_webhook_events_workspace_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "processed_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"billing_webhook_events_type_idx": {
|
|
"name": "billing_webhook_events_type_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "event_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"billing_webhook_events_workspace_id_workspaces_id_fk": {
|
|
"name": "billing_webhook_events_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "billing_webhook_events",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.deliveries": {
|
|
"name": "deliveries",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"render_id": {
|
|
"name": "render_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"job_id": {
|
|
"name": "job_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"platform": {
|
|
"name": "platform",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "delivery_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'DRAFT'"
|
|
},
|
|
"destination": {
|
|
"name": "destination",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"external_id": {
|
|
"name": "external_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"published_url": {
|
|
"name": "published_url",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"scheduled_at": {
|
|
"name": "scheduled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"published_at": {
|
|
"name": "published_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"error_message": {
|
|
"name": "error_message",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"deliveries_render_idx": {
|
|
"name": "deliveries_render_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "render_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"deliveries_job_idx": {
|
|
"name": "deliveries_job_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "job_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"deliveries_status_idx": {
|
|
"name": "deliveries_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"deliveries_render_id_renders_id_fk": {
|
|
"name": "deliveries_render_id_renders_id_fk",
|
|
"tableFrom": "deliveries",
|
|
"tableTo": "renders",
|
|
"columnsFrom": [
|
|
"render_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"deliveries_job_id_generation_jobs_id_fk": {
|
|
"name": "deliveries_job_id_generation_jobs_id_fk",
|
|
"tableFrom": "deliveries",
|
|
"tableTo": "generation_jobs",
|
|
"columnsFrom": [
|
|
"job_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"deliveries_created_by_id_users_id_fk": {
|
|
"name": "deliveries_created_by_id_users_id_fk",
|
|
"tableFrom": "deliveries",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.episodes": {
|
|
"name": "episodes",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"project_id": {
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"episode_number": {
|
|
"name": "episode_number",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(200)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"synopsis": {
|
|
"name": "synopsis",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"target_duration_seconds": {
|
|
"name": "target_duration_seconds",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 180
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "episode_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'OUTLINE'"
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"episodes_project_number_unique": {
|
|
"name": "episodes_project_number_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "project_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "episode_number",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"episodes_project_idx": {
|
|
"name": "episodes_project_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "project_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"episodes_project_id_projects_id_fk": {
|
|
"name": "episodes_project_id_projects_id_fk",
|
|
"tableFrom": "episodes",
|
|
"tableTo": "projects",
|
|
"columnsFrom": [
|
|
"project_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"episodes_created_by_id_users_id_fk": {
|
|
"name": "episodes_created_by_id_users_id_fk",
|
|
"tableFrom": "episodes",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.generation_jobs": {
|
|
"name": "generation_jobs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"project_id": {
|
|
"name": "project_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"episode_id": {
|
|
"name": "episode_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"production_run_id": {
|
|
"name": "production_run_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"type": {
|
|
"name": "type",
|
|
"type": "job_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "job_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'QUEUED'"
|
|
},
|
|
"progress": {
|
|
"name": "progress",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"provider": {
|
|
"name": "provider",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"provider_model": {
|
|
"name": "provider_model",
|
|
"type": "varchar(160)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"external_id": {
|
|
"name": "external_id",
|
|
"type": "varchar(255)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"idempotency_key": {
|
|
"name": "idempotency_key",
|
|
"type": "varchar(180)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"input": {
|
|
"name": "input",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"output": {
|
|
"name": "output",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"error_code": {
|
|
"name": "error_code",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"error_message": {
|
|
"name": "error_message",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"attempts": {
|
|
"name": "attempts",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 0
|
|
},
|
|
"max_attempts": {
|
|
"name": "max_attempts",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 3
|
|
},
|
|
"estimated_credits": {
|
|
"name": "estimated_credits",
|
|
"type": "numeric(20, 4)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'0'"
|
|
},
|
|
"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
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"generation_jobs_idempotency_unique": {
|
|
"name": "generation_jobs_idempotency_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "idempotency_key",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"generation_jobs_workspace_status_idx": {
|
|
"name": "generation_jobs_workspace_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"generation_jobs_project_idx": {
|
|
"name": "generation_jobs_project_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "project_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"generation_jobs_production_run_idx": {
|
|
"name": "generation_jobs_production_run_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "production_run_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"generation_jobs_workspace_id_workspaces_id_fk": {
|
|
"name": "generation_jobs_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "generation_jobs",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"generation_jobs_project_id_projects_id_fk": {
|
|
"name": "generation_jobs_project_id_projects_id_fk",
|
|
"tableFrom": "generation_jobs",
|
|
"tableTo": "projects",
|
|
"columnsFrom": [
|
|
"project_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"generation_jobs_episode_id_episodes_id_fk": {
|
|
"name": "generation_jobs_episode_id_episodes_id_fk",
|
|
"tableFrom": "generation_jobs",
|
|
"tableTo": "episodes",
|
|
"columnsFrom": [
|
|
"episode_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"generation_jobs_production_run_id_production_runs_id_fk": {
|
|
"name": "generation_jobs_production_run_id_production_runs_id_fk",
|
|
"tableFrom": "generation_jobs",
|
|
"tableTo": "production_runs",
|
|
"columnsFrom": [
|
|
"production_run_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"generation_jobs_created_by_id_users_id_fk": {
|
|
"name": "generation_jobs_created_by_id_users_id_fk",
|
|
"tableFrom": "generation_jobs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.memberships": {
|
|
"name": "memberships",
|
|
"schema": "",
|
|
"columns": {
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "membership_role",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'VIEWER'"
|
|
},
|
|
"invited_by_id": {
|
|
"name": "invited_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"joined_at": {
|
|
"name": "joined_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"memberships_user_idx": {
|
|
"name": "memberships_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"memberships_workspace_id_workspaces_id_fk": {
|
|
"name": "memberships_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "memberships",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"memberships_user_id_users_id_fk": {
|
|
"name": "memberships_user_id_users_id_fk",
|
|
"tableFrom": "memberships",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"memberships_invited_by_id_users_id_fk": {
|
|
"name": "memberships_invited_by_id_users_id_fk",
|
|
"tableFrom": "memberships",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"invited_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {
|
|
"memberships_workspace_id_user_id_pk": {
|
|
"name": "memberships_workspace_id_user_id_pk",
|
|
"columns": [
|
|
"workspace_id",
|
|
"user_id"
|
|
]
|
|
}
|
|
},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.production_runs": {
|
|
"name": "production_runs",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"episode_id": {
|
|
"name": "episode_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"render_id": {
|
|
"name": "render_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "production_run_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'QUEUED'"
|
|
},
|
|
"settings": {
|
|
"name": "settings",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"total_jobs": {
|
|
"name": "total_jobs",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"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
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"production_runs_render_unique": {
|
|
"name": "production_runs_render_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "render_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"production_runs_episode_status_idx": {
|
|
"name": "production_runs_episode_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"production_runs_episode_created_idx": {
|
|
"name": "production_runs_episode_created_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"production_runs_episode_id_episodes_id_fk": {
|
|
"name": "production_runs_episode_id_episodes_id_fk",
|
|
"tableFrom": "production_runs",
|
|
"tableTo": "episodes",
|
|
"columnsFrom": [
|
|
"episode_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"production_runs_render_id_renders_id_fk": {
|
|
"name": "production_runs_render_id_renders_id_fk",
|
|
"tableFrom": "production_runs",
|
|
"tableTo": "renders",
|
|
"columnsFrom": [
|
|
"render_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"production_runs_created_by_id_users_id_fk": {
|
|
"name": "production_runs_created_by_id_users_id_fk",
|
|
"tableFrom": "production_runs",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.projects": {
|
|
"name": "projects",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(180)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "varchar(100)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"logline": {
|
|
"name": "logline",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"genre": {
|
|
"name": "genre",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'都市悬疑'"
|
|
},
|
|
"visual_bible": {
|
|
"name": "visual_bible",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "project_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'DRAFT'"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"projects_workspace_slug_unique": {
|
|
"name": "projects_workspace_slug_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "slug",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"projects_workspace_idx": {
|
|
"name": "projects_workspace_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"projects_workspace_id_workspaces_id_fk": {
|
|
"name": "projects_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "projects",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"projects_created_by_id_users_id_fk": {
|
|
"name": "projects_created_by_id_users_id_fk",
|
|
"tableFrom": "projects",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.refresh_tokens": {
|
|
"name": "refresh_tokens",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"token_hash": {
|
|
"name": "token_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"revoked_at": {
|
|
"name": "revoked_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"replaced_by_id": {
|
|
"name": "replaced_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"user_agent": {
|
|
"name": "user_agent",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"ip_address": {
|
|
"name": "ip_address",
|
|
"type": "varchar(64)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"refresh_tokens_hash_unique": {
|
|
"name": "refresh_tokens_hash_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "token_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"refresh_tokens_user_idx": {
|
|
"name": "refresh_tokens_user_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "user_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"refresh_tokens_user_id_users_id_fk": {
|
|
"name": "refresh_tokens_user_id_users_id_fk",
|
|
"tableFrom": "refresh_tokens",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.renders": {
|
|
"name": "renders",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"episode_id": {
|
|
"name": "episode_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"version": {
|
|
"name": "version",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "render_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'QUEUED'"
|
|
},
|
|
"storage_key": {
|
|
"name": "storage_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"thumbnail_key": {
|
|
"name": "thumbnail_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"mime_type": {
|
|
"name": "mime_type",
|
|
"type": "varchar(120)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'video/mp4'"
|
|
},
|
|
"byte_size": {
|
|
"name": "byte_size",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"duration_ms": {
|
|
"name": "duration_ms",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"width": {
|
|
"name": "width",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"height": {
|
|
"name": "height",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"fps": {
|
|
"name": "fps",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 24
|
|
},
|
|
"settings": {
|
|
"name": "settings",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"quality_report": {
|
|
"name": "quality_report",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"renders_episode_version_unique": {
|
|
"name": "renders_episode_version_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "version",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"renders_episode_status_idx": {
|
|
"name": "renders_episode_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"renders_episode_id_episodes_id_fk": {
|
|
"name": "renders_episode_id_episodes_id_fk",
|
|
"tableFrom": "renders",
|
|
"tableTo": "episodes",
|
|
"columnsFrom": [
|
|
"episode_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"renders_created_by_id_users_id_fk": {
|
|
"name": "renders_created_by_id_users_id_fk",
|
|
"tableFrom": "renders",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.review_comments": {
|
|
"name": "review_comments",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"review_request_id": {
|
|
"name": "review_request_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"author_id": {
|
|
"name": "author_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"body": {
|
|
"name": "body",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"timecode_ms": {
|
|
"name": "timecode_ms",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"review_comments_request_idx": {
|
|
"name": "review_comments_request_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "review_request_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"review_comments_review_request_id_review_requests_id_fk": {
|
|
"name": "review_comments_review_request_id_review_requests_id_fk",
|
|
"tableFrom": "review_comments",
|
|
"tableTo": "review_requests",
|
|
"columnsFrom": [
|
|
"review_request_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"review_comments_author_id_users_id_fk": {
|
|
"name": "review_comments_author_id_users_id_fk",
|
|
"tableFrom": "review_comments",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"author_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.review_requests": {
|
|
"name": "review_requests",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_type": {
|
|
"name": "target_type",
|
|
"type": "review_target_type",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"target_id": {
|
|
"name": "target_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "review_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'OPEN'"
|
|
},
|
|
"requested_by_id": {
|
|
"name": "requested_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"assigned_to_id": {
|
|
"name": "assigned_to_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"resolved_by_id": {
|
|
"name": "resolved_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"summary": {
|
|
"name": "summary",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"resolved_at": {
|
|
"name": "resolved_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"review_requests_workspace_status_idx": {
|
|
"name": "review_requests_workspace_status_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "status",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"review_requests_target_idx": {
|
|
"name": "review_requests_target_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "target_type",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "target_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"review_requests_workspace_id_workspaces_id_fk": {
|
|
"name": "review_requests_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "review_requests",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"review_requests_requested_by_id_users_id_fk": {
|
|
"name": "review_requests_requested_by_id_users_id_fk",
|
|
"tableFrom": "review_requests",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"requested_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
},
|
|
"review_requests_assigned_to_id_users_id_fk": {
|
|
"name": "review_requests_assigned_to_id_users_id_fk",
|
|
"tableFrom": "review_requests",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"assigned_to_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"review_requests_resolved_by_id_users_id_fk": {
|
|
"name": "review_requests_resolved_by_id_users_id_fk",
|
|
"tableFrom": "review_requests",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"resolved_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.script_versions": {
|
|
"name": "script_versions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"episode_id": {
|
|
"name": "episode_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"version": {
|
|
"name": "version",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(200)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"content": {
|
|
"name": "content",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"plain_text": {
|
|
"name": "plain_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"change_summary": {
|
|
"name": "change_summary",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"is_current": {
|
|
"name": "is_current",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"script_versions_episode_version_unique": {
|
|
"name": "script_versions_episode_version_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "version",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"script_versions_episode_current_idx": {
|
|
"name": "script_versions_episode_current_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "is_current",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"script_versions_episode_id_episodes_id_fk": {
|
|
"name": "script_versions_episode_id_episodes_id_fk",
|
|
"tableFrom": "script_versions",
|
|
"tableTo": "episodes",
|
|
"columnsFrom": [
|
|
"episode_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"script_versions_created_by_id_users_id_fk": {
|
|
"name": "script_versions_created_by_id_users_id_fk",
|
|
"tableFrom": "script_versions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.shot_versions": {
|
|
"name": "shot_versions",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"shot_id": {
|
|
"name": "shot_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"version": {
|
|
"name": "version",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"image_asset_version_id": {
|
|
"name": "image_asset_version_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"video_storage_key": {
|
|
"name": "video_storage_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"audio_storage_key": {
|
|
"name": "audio_storage_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"subtitle_text": {
|
|
"name": "subtitle_text",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"generation_params": {
|
|
"name": "generation_params",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"is_current": {
|
|
"name": "is_current",
|
|
"type": "boolean",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": false
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"shot_versions_shot_version_unique": {
|
|
"name": "shot_versions_shot_version_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "shot_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "version",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"shot_versions_current_idx": {
|
|
"name": "shot_versions_current_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "shot_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "is_current",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"shot_versions_shot_id_shots_id_fk": {
|
|
"name": "shot_versions_shot_id_shots_id_fk",
|
|
"tableFrom": "shot_versions",
|
|
"tableTo": "shots",
|
|
"columnsFrom": [
|
|
"shot_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"shot_versions_image_asset_version_id_asset_versions_id_fk": {
|
|
"name": "shot_versions_image_asset_version_id_asset_versions_id_fk",
|
|
"tableFrom": "shot_versions",
|
|
"tableTo": "asset_versions",
|
|
"columnsFrom": [
|
|
"image_asset_version_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"shot_versions_created_by_id_users_id_fk": {
|
|
"name": "shot_versions_created_by_id_users_id_fk",
|
|
"tableFrom": "shot_versions",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.shots": {
|
|
"name": "shots",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"episode_id": {
|
|
"name": "episode_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"shot_number": {
|
|
"name": "shot_number",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"scene_number": {
|
|
"name": "scene_number",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"title": {
|
|
"name": "title",
|
|
"type": "varchar(180)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"description": {
|
|
"name": "description",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "''"
|
|
},
|
|
"shot_type": {
|
|
"name": "shot_type",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'中景'"
|
|
},
|
|
"camera_motion": {
|
|
"name": "camera_motion",
|
|
"type": "varchar(50)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'静止'"
|
|
},
|
|
"duration_ms": {
|
|
"name": "duration_ms",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 3000
|
|
},
|
|
"status": {
|
|
"name": "status",
|
|
"type": "shot_status",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'DRAFT'"
|
|
},
|
|
"character_asset_ids": {
|
|
"name": "character_asset_ids",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'[]'::jsonb"
|
|
},
|
|
"scene_asset_id": {
|
|
"name": "scene_asset_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"sort_order": {
|
|
"name": "sort_order",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_by_id": {
|
|
"name": "created_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"shots_episode_number_unique": {
|
|
"name": "shots_episode_number_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "shot_number",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"shots_episode_sort_idx": {
|
|
"name": "shots_episode_sort_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "episode_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "sort_order",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"shots_episode_id_episodes_id_fk": {
|
|
"name": "shots_episode_id_episodes_id_fk",
|
|
"tableFrom": "shots",
|
|
"tableTo": "episodes",
|
|
"columnsFrom": [
|
|
"episode_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"shots_scene_asset_id_assets_id_fk": {
|
|
"name": "shots_scene_asset_id_assets_id_fk",
|
|
"tableFrom": "shots",
|
|
"tableTo": "assets",
|
|
"columnsFrom": [
|
|
"scene_asset_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"shots_created_by_id_users_id_fk": {
|
|
"name": "shots_created_by_id_users_id_fk",
|
|
"tableFrom": "shots",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"created_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.usage_ledger": {
|
|
"name": "usage_ledger",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"user_id": {
|
|
"name": "user_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"job_id": {
|
|
"name": "job_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"type": "usage_kind",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"quantity": {
|
|
"name": "quantity",
|
|
"type": "numeric(20, 4)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"credits": {
|
|
"name": "credits",
|
|
"type": "numeric(20, 4)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"provider_cost_usd": {
|
|
"name": "provider_cost_usd",
|
|
"type": "numeric(20, 6)",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"metadata": {
|
|
"name": "metadata",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"occurred_at": {
|
|
"name": "occurred_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"usage_ledger_workspace_time_idx": {
|
|
"name": "usage_ledger_workspace_time_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "occurred_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"usage_ledger_job_idx": {
|
|
"name": "usage_ledger_job_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "job_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"usage_ledger_workspace_id_workspaces_id_fk": {
|
|
"name": "usage_ledger_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "usage_ledger",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"usage_ledger_user_id_users_id_fk": {
|
|
"name": "usage_ledger_user_id_users_id_fk",
|
|
"tableFrom": "usage_ledger",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"user_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"usage_ledger_job_id_generation_jobs_id_fk": {
|
|
"name": "usage_ledger_job_id_generation_jobs_id_fk",
|
|
"tableFrom": "usage_ledger",
|
|
"tableTo": "generation_jobs",
|
|
"columnsFrom": [
|
|
"job_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.users": {
|
|
"name": "users",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(320)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"display_name": {
|
|
"name": "display_name",
|
|
"type": "varchar(120)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"password_hash": {
|
|
"name": "password_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"avatar_key": {
|
|
"name": "avatar_key",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"email_verified_at": {
|
|
"name": "email_verified_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"disabled_at": {
|
|
"name": "disabled_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"users_email_unique": {
|
|
"name": "users_email_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "email",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.workspace_invitations": {
|
|
"name": "workspace_invitations",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"workspace_id": {
|
|
"name": "workspace_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"email": {
|
|
"name": "email",
|
|
"type": "varchar(320)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"role": {
|
|
"name": "role",
|
|
"type": "membership_role",
|
|
"typeSchema": "public",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'VIEWER'"
|
|
},
|
|
"token_hash": {
|
|
"name": "token_hash",
|
|
"type": "text",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"expires_at": {
|
|
"name": "expires_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"accepted_at": {
|
|
"name": "accepted_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"accepted_by_id": {
|
|
"name": "accepted_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"revoked_at": {
|
|
"name": "revoked_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": false
|
|
},
|
|
"invited_by_id": {
|
|
"name": "invited_by_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"workspace_invitations_token_hash_unique": {
|
|
"name": "workspace_invitations_token_hash_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "token_hash",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"workspace_invitations_workspace_email_idx": {
|
|
"name": "workspace_invitations_workspace_email_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "email",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"workspace_invitations_workspace_created_idx": {
|
|
"name": "workspace_invitations_workspace_created_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "workspace_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
},
|
|
{
|
|
"expression": "created_at",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"workspace_invitations_workspace_id_workspaces_id_fk": {
|
|
"name": "workspace_invitations_workspace_id_workspaces_id_fk",
|
|
"tableFrom": "workspace_invitations",
|
|
"tableTo": "workspaces",
|
|
"columnsFrom": [
|
|
"workspace_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "cascade",
|
|
"onUpdate": "no action"
|
|
},
|
|
"workspace_invitations_accepted_by_id_users_id_fk": {
|
|
"name": "workspace_invitations_accepted_by_id_users_id_fk",
|
|
"tableFrom": "workspace_invitations",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"accepted_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "set null",
|
|
"onUpdate": "no action"
|
|
},
|
|
"workspace_invitations_invited_by_id_users_id_fk": {
|
|
"name": "workspace_invitations_invited_by_id_users_id_fk",
|
|
"tableFrom": "workspace_invitations",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"invited_by_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
},
|
|
"public.workspaces": {
|
|
"name": "workspaces",
|
|
"schema": "",
|
|
"columns": {
|
|
"id": {
|
|
"name": "id",
|
|
"type": "uuid",
|
|
"primaryKey": true,
|
|
"notNull": true,
|
|
"default": "gen_random_uuid()"
|
|
},
|
|
"name": {
|
|
"name": "name",
|
|
"type": "varchar(160)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"slug": {
|
|
"name": "slug",
|
|
"type": "varchar(80)",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"owner_id": {
|
|
"name": "owner_id",
|
|
"type": "uuid",
|
|
"primaryKey": false,
|
|
"notNull": true
|
|
},
|
|
"plan": {
|
|
"name": "plan",
|
|
"type": "varchar(32)",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'PRO'"
|
|
},
|
|
"monthly_credit_limit": {
|
|
"name": "monthly_credit_limit",
|
|
"type": "integer",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": 10000
|
|
},
|
|
"settings": {
|
|
"name": "settings",
|
|
"type": "jsonb",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "'{}'::jsonb"
|
|
},
|
|
"created_at": {
|
|
"name": "created_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
},
|
|
"updated_at": {
|
|
"name": "updated_at",
|
|
"type": "timestamp with time zone",
|
|
"primaryKey": false,
|
|
"notNull": true,
|
|
"default": "now()"
|
|
}
|
|
},
|
|
"indexes": {
|
|
"workspaces_slug_unique": {
|
|
"name": "workspaces_slug_unique",
|
|
"columns": [
|
|
{
|
|
"expression": "slug",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": true,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
},
|
|
"workspaces_owner_idx": {
|
|
"name": "workspaces_owner_idx",
|
|
"columns": [
|
|
{
|
|
"expression": "owner_id",
|
|
"isExpression": false,
|
|
"asc": true,
|
|
"nulls": "last"
|
|
}
|
|
],
|
|
"isUnique": false,
|
|
"concurrently": false,
|
|
"method": "btree",
|
|
"with": {}
|
|
}
|
|
},
|
|
"foreignKeys": {
|
|
"workspaces_owner_id_users_id_fk": {
|
|
"name": "workspaces_owner_id_users_id_fk",
|
|
"tableFrom": "workspaces",
|
|
"tableTo": "users",
|
|
"columnsFrom": [
|
|
"owner_id"
|
|
],
|
|
"columnsTo": [
|
|
"id"
|
|
],
|
|
"onDelete": "restrict",
|
|
"onUpdate": "no action"
|
|
}
|
|
},
|
|
"compositePrimaryKeys": {},
|
|
"uniqueConstraints": {},
|
|
"policies": {},
|
|
"checkConstraints": {},
|
|
"isRLSEnabled": false
|
|
}
|
|
},
|
|
"enums": {
|
|
"public.account_token_type": {
|
|
"name": "account_token_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"EMAIL_VERIFICATION",
|
|
"PASSWORD_RESET"
|
|
]
|
|
},
|
|
"public.asset_status": {
|
|
"name": "asset_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"DRAFT",
|
|
"GENERATING",
|
|
"REVIEW",
|
|
"APPROVED",
|
|
"ARCHIVED"
|
|
]
|
|
},
|
|
"public.asset_type": {
|
|
"name": "asset_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"CHARACTER",
|
|
"SCENE",
|
|
"PROP",
|
|
"VOICE",
|
|
"MUSIC",
|
|
"SHOT"
|
|
]
|
|
},
|
|
"public.delivery_status": {
|
|
"name": "delivery_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"DRAFT",
|
|
"QUEUED",
|
|
"PUBLISHING",
|
|
"PUBLISHED",
|
|
"FAILED",
|
|
"CANCELLED"
|
|
]
|
|
},
|
|
"public.episode_status": {
|
|
"name": "episode_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"OUTLINE",
|
|
"SCRIPTING",
|
|
"STORYBOARDING",
|
|
"PRODUCTION",
|
|
"REVIEW",
|
|
"PUBLISHED"
|
|
]
|
|
},
|
|
"public.job_status": {
|
|
"name": "job_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"QUEUED",
|
|
"RUNNING",
|
|
"SUCCEEDED",
|
|
"FAILED",
|
|
"CANCELLED"
|
|
]
|
|
},
|
|
"public.job_type": {
|
|
"name": "job_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"PIPELINE_HEALTHCHECK",
|
|
"SCRIPT_GENERATE",
|
|
"STORYBOARD_GENERATE",
|
|
"ASSET_GENERATE",
|
|
"TTS_GENERATE",
|
|
"VIDEO_GENERATE",
|
|
"LIPSYNC_GENERATE",
|
|
"EPISODE_RENDER",
|
|
"DELIVERY_PUBLISH"
|
|
]
|
|
},
|
|
"public.membership_role": {
|
|
"name": "membership_role",
|
|
"schema": "public",
|
|
"values": [
|
|
"OWNER",
|
|
"ADMIN",
|
|
"EDITOR",
|
|
"REVIEWER",
|
|
"VIEWER"
|
|
]
|
|
},
|
|
"public.production_run_status": {
|
|
"name": "production_run_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"QUEUED",
|
|
"RUNNING",
|
|
"SUCCEEDED",
|
|
"FAILED",
|
|
"CANCELLED"
|
|
]
|
|
},
|
|
"public.project_status": {
|
|
"name": "project_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"DRAFT",
|
|
"ACTIVE",
|
|
"ARCHIVED"
|
|
]
|
|
},
|
|
"public.render_status": {
|
|
"name": "render_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"QUEUED",
|
|
"RENDERING",
|
|
"REVIEW",
|
|
"APPROVED",
|
|
"FAILED"
|
|
]
|
|
},
|
|
"public.review_status": {
|
|
"name": "review_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"OPEN",
|
|
"APPROVED",
|
|
"CHANGES_REQUESTED",
|
|
"CANCELLED"
|
|
]
|
|
},
|
|
"public.review_target_type": {
|
|
"name": "review_target_type",
|
|
"schema": "public",
|
|
"values": [
|
|
"SCRIPT_VERSION",
|
|
"ASSET_VERSION",
|
|
"SHOT_VERSION",
|
|
"RENDER"
|
|
]
|
|
},
|
|
"public.shot_status": {
|
|
"name": "shot_status",
|
|
"schema": "public",
|
|
"values": [
|
|
"DRAFT",
|
|
"GENERATING",
|
|
"REVIEW",
|
|
"APPROVED",
|
|
"RENDERED"
|
|
]
|
|
},
|
|
"public.usage_kind": {
|
|
"name": "usage_kind",
|
|
"schema": "public",
|
|
"values": [
|
|
"TEXT_INPUT_TOKEN",
|
|
"TEXT_OUTPUT_TOKEN",
|
|
"IMAGE",
|
|
"AUDIO_SECOND",
|
|
"VIDEO_SECOND",
|
|
"RENDER_SECOND",
|
|
"STORAGE_BYTE_MONTH"
|
|
]
|
|
}
|
|
},
|
|
"schemas": {},
|
|
"sequences": {},
|
|
"roles": {},
|
|
"policies": {},
|
|
"views": {},
|
|
"_meta": {
|
|
"columns": {},
|
|
"schemas": {},
|
|
"tables": {}
|
|
}
|
|
} |