⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.
TypeScript agenticagileai-agentsbug-reportingbug-trackerganttissue-trackerjirajira-alternativekanbanlinearlinear-alternativeopen-sourceproduct-managementproject-managementroadmapself-hostedsprint-planningteam-collaborationtrello-alternative
{
"id": "c8bbed7d-fe9e-45d7-b9c8-ff383c564a61",
"prevId": "7a1a65e1-a1d1-4cb5-9d0a-c5df99d4cc4b",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.account": {
"name": "account",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"account_id": {
"name": "account_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"provider_id": {
"name": "provider_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"access_token": {
"name": "access_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"refresh_token": {
"name": "refresh_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"id_token": {
"name": "id_token",
"type": "text",
"primaryKey": false,
"notNull": false
},
"access_token_expires_at": {
"name": "access_token_expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"refresh_token_expires_at": {
"name": "refresh_token_expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"scope": {
"name": "scope",
"type": "text",
"primaryKey": false,
"notNull": false
},
"password": {
"name": "password",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"account_userId_idx": {
"name": "account_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"account_user_id_user_id_fk": {
"name": "account_user_id_user_id_fk",
"tableFrom": "account",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.apikey": {
"name": "apikey",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"config_id": {
"name": "config_id",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"start": {
"name": "start",
"type": "text",
"primaryKey": false,
"notNull": false
},
"reference_id": {
"name": "reference_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"prefix": {
"name": "prefix",
"type": "text",
"primaryKey": false,
"notNull": false
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"refill_interval": {
"name": "refill_interval",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"refill_amount": {
"name": "refill_amount",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"last_refill_at": {
"name": "last_refill_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"rate_limit_enabled": {
"name": "rate_limit_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": true
},
"rate_limit_time_window": {
"name": "rate_limit_time_window",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 86400000
},
"rate_limit_max": {
"name": "rate_limit_max",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 10
},
"request_count": {
"name": "request_count",
"type": "integer",
"primaryKey": false,
"notNull": false,
"default": 0
},
"remaining": {
"name": "remaining",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"last_request": {
"name": "last_request",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"permissions": {
"name": "permissions",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metadata": {
"name": "metadata",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"apikey_configId_idx": {
"name": "apikey_configId_idx",
"columns": [
{
"expression": "config_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"apikey_referenceId_idx": {
"name": "apikey_referenceId_idx",
"columns": [
{
"expression": "reference_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"apikey_key_idx": {
"name": "apikey_key_idx",
"columns": [
{
"expression": "key",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.passkey": {
"name": "passkey",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"public_key": {
"name": "public_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"credential_id": {
"name": "credential_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"counter": {
"name": "counter",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"device_type": {
"name": "device_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"backed_up": {
"name": "backed_up",
"type": "boolean",
"primaryKey": false,
"notNull": true
},
"transports": {
"name": "transports",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": false
},
"aaguid": {
"name": "aaguid",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"passkey_userId_idx": {
"name": "passkey_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"passkey_credentialID_idx": {
"name": "passkey_credentialID_idx",
"columns": [
{
"expression": "credential_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"passkey_user_id_user_id_fk": {
"name": "passkey_user_id_user_id_fk",
"tableFrom": "passkey",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.session": {
"name": "session",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"token": {
"name": "token",
"type": "text",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"ip_address": {
"name": "ip_address",
"type": "text",
"primaryKey": false,
"notNull": false
},
"user_agent": {
"name": "user_agent",
"type": "text",
"primaryKey": false,
"notNull": false
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"session_userId_idx": {
"name": "session_userId_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"session_user_id_user_id_fk": {
"name": "session_user_id_user_id_fk",
"tableFrom": "session",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"session_token_unique": {
"name": "session_token_unique",
"columns": [
"token"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user": {
"name": "user",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email_verified": {
"name": "email_verified",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"image": {
"name": "image",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": false,
"default": "'user'"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"user_email_unique": {
"name": "user_email_unique",
"columns": [
"email"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.verification": {
"name": "verification",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"identifier": {
"name": "identifier",
"type": "text",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"expires_at": {
"name": "expires_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"verification_identifier_idx": {
"name": "verification_identifier_idx",
"columns": [
{
"expression": "identifier",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.agent_run": {
"name": "agent_run",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"agent_id": {
"name": "agent_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"schedule_id": {
"name": "schedule_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"trigger": {
"name": "trigger",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'delegation'"
},
"scheduled_for": {
"name": "scheduled_for",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"source_activity_id": {
"name": "source_activity_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"prompt": {
"name": "prompt",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"attempts": {
"name": "attempts",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"next_attempt_at": {
"name": "next_attempt_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"output": {
"name": "output",
"type": "text",
"primaryKey": false,
"notNull": false
},
"started_at": {
"name": "started_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"finished_at": {
"name": "finished_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": {
"agent_run_schedule_fire_uq": {
"name": "agent_run_schedule_fire_uq",
"columns": [
{
"expression": "schedule_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "scheduled_for",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"concurrently": false
},
"agent_run_due_idx": {
"name": "agent_run_due_idx",
"columns": [
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "next_attempt_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"agent_run_schedule_idx": {
"name": "agent_run_schedule_idx",
"columns": [
{
"expression": "schedule_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"agent_run_agent_id_ai_agent_id_fk": {
"name": "agent_run_agent_id_ai_agent_id_fk",
"tableFrom": "agent_run",
"columnsFrom": [
"agent_id"
],
"tableTo": "ai_agent",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"agent_run_issue_id_issue_id_fk": {
"name": "agent_run_issue_id_issue_id_fk",
"tableFrom": "agent_run",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"agent_run_schedule_id_agent_schedule_id_fk": {
"name": "agent_run_schedule_id_agent_schedule_id_fk",
"tableFrom": "agent_run",
"columnsFrom": [
"schedule_id"
],
"tableTo": "agent_schedule",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"agent_run_source_activity_id_issue_activity_id_fk": {
"name": "agent_run_source_activity_id_issue_activity_id_fk",
"tableFrom": "agent_run",
"columnsFrom": [
"source_activity_id"
],
"tableTo": "issue_activity",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"agent_run_status_check": {
"name": "agent_run_status_check",
"value": "\"agent_run\".\"status\" IN ('pending', 'success', 'failed')"
},
"agent_run_trigger_check": {
"name": "agent_run_trigger_check",
"value": "\"agent_run\".\"trigger\" IN ('mention', 'delegation', 'schedule', 'manual')"
}
},
"isRLSEnabled": false
},
"public.agent_schedule": {
"name": "agent_schedule",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"agent_id": {
"name": "agent_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"prompt": {
"name": "prompt",
"type": "text",
"primaryKey": false,
"notNull": true
},
"cron": {
"name": "cron",
"type": "text",
"primaryKey": false,
"notNull": true
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"next_run_at": {
"name": "next_run_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true
},
"last_run_at": {
"name": "last_run_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": {
"agent_schedule_due_idx": {
"name": "agent_schedule_due_idx",
"columns": [
{
"expression": "status",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "next_run_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"agent_schedule_agent_idx": {
"name": "agent_schedule_agent_idx",
"columns": [
{
"expression": "agent_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"agent_schedule_agent_id_ai_agent_id_fk": {
"name": "agent_schedule_agent_id_ai_agent_id_fk",
"tableFrom": "agent_schedule",
"columnsFrom": [
"agent_id"
],
"tableTo": "ai_agent",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"agent_schedule_agent_id_name_unique": {
"name": "agent_schedule_agent_id_name_unique",
"columns": [
"agent_id",
"name"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {
"agent_schedule_status_check": {
"name": "agent_schedule_status_check",
"value": "\"agent_schedule\".\"status\" IN ('active', 'paused')"
}
},
"isRLSEnabled": false
},
"public.agent_skill": {
"name": "agent_skill",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true
},
"source_url": {
"name": "source_url",
"type": "text",
"primaryKey": false,
"notNull": false
},
"s3_prefix": {
"name": "s3_prefix",
"type": "text",
"primaryKey": false,
"notNull": true
},
"files": {
"name": "files",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"agent_skill_project_idx": {
"name": "agent_skill_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"agent_skill_project_id_project_id_fk": {
"name": "agent_skill_project_id_project_id_fk",
"tableFrom": "agent_skill",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"agent_skill_project_id_name_unique": {
"name": "agent_skill_project_id_name_unique",
"columns": [
"project_id",
"name"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {
"agent_skill_source_check": {
"name": "agent_skill_source_check",
"value": "\"agent_skill\".\"source\" IN ('upload', 'inline', 'github')"
}
},
"isRLSEnabled": false
},
"public.agent_skill_link": {
"name": "agent_skill_link",
"schema": "",
"columns": {
"agent_id": {
"name": "agent_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"skill_id": {
"name": "skill_id",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"agent_skill_link_skill_idx": {
"name": "agent_skill_link_skill_idx",
"columns": [
{
"expression": "skill_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"agent_skill_link_agent_id_ai_agent_id_fk": {
"name": "agent_skill_link_agent_id_ai_agent_id_fk",
"tableFrom": "agent_skill_link",
"columnsFrom": [
"agent_id"
],
"tableTo": "ai_agent",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"agent_skill_link_skill_id_agent_skill_id_fk": {
"name": "agent_skill_link_skill_id_agent_skill_id_fk",
"tableFrom": "agent_skill_link",
"columnsFrom": [
"skill_id"
],
"tableTo": "agent_skill",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {
"agent_skill_link_agent_id_skill_id_pk": {
"name": "agent_skill_link_agent_id_skill_id_pk",
"columns": [
"agent_id",
"skill_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.agent_tool": {
"name": "agent_tool",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"tool_key": {
"name": "tool_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"credential_id": {
"name": "credential_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"agent_tool_project_idx": {
"name": "agent_tool_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"agent_tool_credential_idx": {
"name": "agent_tool_credential_idx",
"columns": [
{
"expression": "credential_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"agent_tool_project_id_project_id_fk": {
"name": "agent_tool_project_id_project_id_fk",
"tableFrom": "agent_tool",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"agent_tool_credential_id_integration_credential_id_fk": {
"name": "agent_tool_credential_id_integration_credential_id_fk",
"tableFrom": "agent_tool",
"columnsFrom": [
"credential_id"
],
"tableTo": "integration_credential",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"agent_tool_project_id_tool_key_credential_id_unique": {
"name": "agent_tool_project_id_tool_key_credential_id_unique",
"columns": [
"project_id",
"tool_key",
"credential_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.agent_tool_link": {
"name": "agent_tool_link",
"schema": "",
"columns": {
"agent_id": {
"name": "agent_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"agent_tool_id": {
"name": "agent_tool_id",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {
"agent_tool_link_tool_idx": {
"name": "agent_tool_link_tool_idx",
"columns": [
{
"expression": "agent_tool_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"agent_tool_link_agent_id_ai_agent_id_fk": {
"name": "agent_tool_link_agent_id_ai_agent_id_fk",
"tableFrom": "agent_tool_link",
"columnsFrom": [
"agent_id"
],
"tableTo": "ai_agent",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"agent_tool_link_agent_tool_id_agent_tool_id_fk": {
"name": "agent_tool_link_agent_tool_id_agent_tool_id_fk",
"tableFrom": "agent_tool_link",
"columnsFrom": [
"agent_tool_id"
],
"tableTo": "agent_tool",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {
"agent_tool_link_agent_id_agent_tool_id_pk": {
"name": "agent_tool_link_agent_id_agent_tool_id_pk",
"columns": [
"agent_id",
"agent_tool_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.ai_agent": {
"name": "ai_agent",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": true
},
"kind": {
"name": "kind",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_credential_id": {
"name": "model_credential_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"model": {
"name": "model",
"type": "text",
"primaryKey": false,
"notNull": false
},
"instructions": {
"name": "instructions",
"type": "text",
"primaryKey": false,
"notNull": false
},
"tools": {
"name": "tools",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"temperature": {
"name": "temperature",
"type": "double precision",
"primaryKey": false,
"notNull": false
},
"max_steps": {
"name": "max_steps",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"trigger_on_mention": {
"name": "trigger_on_mention",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"trigger_on_assign": {
"name": "trigger_on_assign",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"role_id": {
"name": "role_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"api_key_ciphertext": {
"name": "api_key_ciphertext",
"type": "text",
"primaryKey": false,
"notNull": false
},
"api_key_iv": {
"name": "api_key_iv",
"type": "text",
"primaryKey": false,
"notNull": false
},
"api_key_auth_tag": {
"name": "api_key_auth_tag",
"type": "text",
"primaryKey": false,
"notNull": false
},
"memory_enabled": {
"name": "memory_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"memory_last_messages": {
"name": "memory_last_messages",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"ai_agent_project_idx": {
"name": "ai_agent_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"ai_agent_project_id_project_id_fk": {
"name": "ai_agent_project_id_project_id_fk",
"tableFrom": "ai_agent",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"ai_agent_user_id_user_id_fk": {
"name": "ai_agent_user_id_user_id_fk",
"tableFrom": "ai_agent",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"ai_agent_model_credential_id_integration_credential_id_fk": {
"name": "ai_agent_model_credential_id_integration_credential_id_fk",
"tableFrom": "ai_agent",
"columnsFrom": [
"model_credential_id"
],
"tableTo": "integration_credential",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"ai_agent_role_id_project_role_id_fk": {
"name": "ai_agent_role_id_project_role_id_fk",
"tableFrom": "ai_agent",
"columnsFrom": [
"role_id"
],
"tableTo": "project_role",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"ai_agent_project_id_username_unique": {
"name": "ai_agent_project_id_username_unique",
"columns": [
"project_id",
"username"
],
"nullsNotDistinct": false
},
"ai_agent_user_id_unique": {
"name": "ai_agent_user_id_unique",
"columns": [
"user_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {
"ai_agent_kind_check": {
"name": "ai_agent_kind_check",
"value": "\"ai_agent\".\"kind\" IN ('external', 'internal')"
}
},
"isRLSEnabled": false
},
"public.app_secret": {
"name": "app_secret",
"schema": "",
"columns": {
"key": {
"name": "key",
"type": "text",
"primaryKey": true,
"notNull": true
},
"ciphertext": {
"name": "ciphertext",
"type": "text",
"primaryKey": false,
"notNull": true
},
"iv": {
"name": "iv",
"type": "text",
"primaryKey": false,
"notNull": true
},
"auth_tag": {
"name": "auth_tag",
"type": "text",
"primaryKey": false,
"notNull": true
},
"redacted": {
"name": "redacted",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.app_setting": {
"name": "app_setting",
"schema": "",
"columns": {
"key": {
"name": "key",
"type": "text",
"primaryKey": true,
"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": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.custom_field": {
"name": "custom_field",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"issue_type_id": {
"name": "issue_type_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"field_type": {
"name": "field_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"show_in_body": {
"name": "show_in_body",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"custom_field_project_id_project_id_fk": {
"name": "custom_field_project_id_project_id_fk",
"tableFrom": "custom_field",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"custom_field_issue_type_id_issue_type_id_fk": {
"name": "custom_field_issue_type_id_issue_type_id_fk",
"tableFrom": "custom_field",
"columnsFrom": [
"issue_type_id"
],
"tableTo": "issue_type",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"custom_field_field_type_check": {
"name": "custom_field_field_type_check",
"value": "\"custom_field\".\"field_type\" IN ('text', 'markdown', 'url', 'number', 'boolean', 'date', 'select', 'multi_select')"
}
},
"isRLSEnabled": false
},
"public.custom_field_option": {
"name": "custom_field_option",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"field_id": {
"name": "field_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"value": {
"name": "value",
"type": "text",
"primaryKey": false,
"notNull": true
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'#6b7280'"
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
}
},
"indexes": {},
"foreignKeys": {
"custom_field_option_field_id_custom_field_id_fk": {
"name": "custom_field_option_field_id_custom_field_id_fk",
"tableFrom": "custom_field_option",
"columnsFrom": [
"field_id"
],
"tableTo": "custom_field",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"custom_field_option_field_id_value_unique": {
"name": "custom_field_option_field_id_value_unique",
"columns": [
"field_id",
"value"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.initiative": {
"name": "initiative",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'planned'"
},
"owner_user_id": {
"name": "owner_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"priority": {
"name": "priority",
"type": "text",
"primaryKey": false,
"notNull": false
},
"start_date": {
"name": "start_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"target_date": {
"name": "target_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"position": {
"name": "position",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"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": {
"initiative_project_idx": {
"name": "initiative_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "position",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"initiative_project_id_project_id_fk": {
"name": "initiative_project_id_project_id_fk",
"tableFrom": "initiative",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"initiative_owner_user_id_user_id_fk": {
"name": "initiative_owner_user_id_user_id_fk",
"tableFrom": "initiative",
"columnsFrom": [
"owner_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"initiative_status_check": {
"name": "initiative_status_check",
"value": "\"initiative\".\"status\" IN ('proposed', 'planned', 'active', 'completed', 'canceled')"
}
},
"isRLSEnabled": false
},
"public.initiative_label": {
"name": "initiative_label",
"schema": "",
"columns": {
"initiative_id": {
"name": "initiative_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"label_id": {
"name": "label_id",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"initiative_label_initiative_id_initiative_id_fk": {
"name": "initiative_label_initiative_id_initiative_id_fk",
"tableFrom": "initiative_label",
"columnsFrom": [
"initiative_id"
],
"tableTo": "initiative",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"initiative_label_label_id_label_id_fk": {
"name": "initiative_label_label_id_label_id_fk",
"tableFrom": "initiative_label",
"columnsFrom": [
"label_id"
],
"tableTo": "label",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {
"initiative_label_initiative_id_label_id_pk": {
"name": "initiative_label_initiative_id_label_id_pk",
"columns": [
"initiative_id",
"label_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.integration_credential": {
"name": "integration_credential",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"integration_key": {
"name": "integration_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"ciphertext": {
"name": "ciphertext",
"type": "text",
"primaryKey": false,
"notNull": true
},
"iv": {
"name": "iv",
"type": "text",
"primaryKey": false,
"notNull": true
},
"auth_tag": {
"name": "auth_tag",
"type": "text",
"primaryKey": false,
"notNull": true
},
"redacted": {
"name": "redacted",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"integration_credential_project_idx": {
"name": "integration_credential_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"integration_credential_project_id_project_id_fk": {
"name": "integration_credential_project_id_project_id_fk",
"tableFrom": "integration_credential",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.issue": {
"name": "issue",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"sequence_number": {
"name": "sequence_number",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"type_id": {
"name": "type_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"initiative_id": {
"name": "initiative_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"column_id": {
"name": "column_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"assignee_user_id": {
"name": "assignee_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"delegate_user_id": {
"name": "delegate_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"priority": {
"name": "priority",
"type": "text",
"primaryKey": false,
"notNull": false
},
"start_date": {
"name": "start_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"due_date": {
"name": "due_date",
"type": "date",
"primaryKey": false,
"notNull": false
},
"position": {
"name": "position",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"archived_at": {
"name": "archived_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"share_token": {
"name": "share_token",
"type": "uuid",
"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": {
"issue_project_active_idx": {
"name": "issue_project_active_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "column_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"where": "\"issue\".\"archived_at\" IS NULL",
"concurrently": false
}
},
"foreignKeys": {
"issue_project_id_project_id_fk": {
"name": "issue_project_id_project_id_fk",
"tableFrom": "issue",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_type_id_issue_type_id_fk": {
"name": "issue_type_id_issue_type_id_fk",
"tableFrom": "issue",
"columnsFrom": [
"type_id"
],
"tableTo": "issue_type",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"issue_initiative_id_initiative_id_fk": {
"name": "issue_initiative_id_initiative_id_fk",
"tableFrom": "issue",
"columnsFrom": [
"initiative_id"
],
"tableTo": "initiative",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"issue_column_id_project_column_id_fk": {
"name": "issue_column_id_project_column_id_fk",
"tableFrom": "issue",
"columnsFrom": [
"column_id"
],
"tableTo": "project_column",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "no action"
},
"issue_assignee_user_id_user_id_fk": {
"name": "issue_assignee_user_id_user_id_fk",
"tableFrom": "issue",
"columnsFrom": [
"assignee_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"issue_delegate_user_id_user_id_fk": {
"name": "issue_delegate_user_id_user_id_fk",
"tableFrom": "issue",
"columnsFrom": [
"delegate_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"issue_share_token_unique": {
"name": "issue_share_token_unique",
"columns": [
"share_token"
],
"nullsNotDistinct": false
},
"issue_project_id_sequence_number_unique": {
"name": "issue_project_id_sequence_number_unique",
"columns": [
"project_id",
"sequence_number"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.issue_activity": {
"name": "issue_activity",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"initiative_id": {
"name": "initiative_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"kind": {
"name": "kind",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_user_id": {
"name": "actor_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"actor_name": {
"name": "actor_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"body": {
"name": "body",
"type": "text",
"primaryKey": false,
"notNull": false
},
"action": {
"name": "action",
"type": "text",
"primaryKey": false,
"notNull": false
},
"subject": {
"name": "subject",
"type": "text",
"primaryKey": false,
"notNull": false
},
"from_text": {
"name": "from_text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"to_text": {
"name": "to_text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"issue_activity_issue_idx": {
"name": "issue_activity_issue_idx",
"columns": [
{
"expression": "issue_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": false,
"nulls": "last"
},
{
"expression": "id",
"isExpression": false,
"asc": false,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"issue_activity_initiative_idx": {
"name": "issue_activity_initiative_idx",
"columns": [
{
"expression": "initiative_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": false,
"nulls": "last"
},
{
"expression": "id",
"isExpression": false,
"asc": false,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"issue_activity_issue_id_issue_id_fk": {
"name": "issue_activity_issue_id_issue_id_fk",
"tableFrom": "issue_activity",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_activity_initiative_id_initiative_id_fk": {
"name": "issue_activity_initiative_id_initiative_id_fk",
"tableFrom": "issue_activity",
"columnsFrom": [
"initiative_id"
],
"tableTo": "initiative",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_activity_actor_user_id_user_id_fk": {
"name": "issue_activity_actor_user_id_user_id_fk",
"tableFrom": "issue_activity",
"columnsFrom": [
"actor_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"issue_activity_kind_check": {
"name": "issue_activity_kind_check",
"value": "\"issue_activity\".\"kind\" IN ('comment', 'activity')"
},
"issue_activity_owner_check": {
"name": "issue_activity_owner_check",
"value": "(\"issue_activity\".\"issue_id\" IS NOT NULL) <> (\"issue_activity\".\"initiative_id\" IS NOT NULL)"
}
},
"isRLSEnabled": false
},
"public.issue_attachment": {
"name": "issue_attachment",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"public_id": {
"name": "public_id",
"type": "uuid",
"primaryKey": false,
"notNull": true,
"default": "gen_random_uuid()"
},
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"s3_key": {
"name": "s3_key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"filename": {
"name": "filename",
"type": "text",
"primaryKey": false,
"notNull": true
},
"content_type": {
"name": "content_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"size_bytes": {
"name": "size_bytes",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"issue_attachment_issue_idx": {
"name": "issue_attachment_issue_idx",
"columns": [
{
"expression": "issue_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"issue_attachment_issue_id_issue_id_fk": {
"name": "issue_attachment_issue_id_issue_id_fk",
"tableFrom": "issue_attachment",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"issue_attachment_public_id_unique": {
"name": "issue_attachment_public_id_unique",
"columns": [
"public_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.issue_field_option": {
"name": "issue_field_option",
"schema": "",
"columns": {
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"field_id": {
"name": "field_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"option_id": {
"name": "option_id",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"issue_field_option_issue_id_issue_id_fk": {
"name": "issue_field_option_issue_id_issue_id_fk",
"tableFrom": "issue_field_option",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_field_option_field_id_custom_field_id_fk": {
"name": "issue_field_option_field_id_custom_field_id_fk",
"tableFrom": "issue_field_option",
"columnsFrom": [
"field_id"
],
"tableTo": "custom_field",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_field_option_option_id_custom_field_option_id_fk": {
"name": "issue_field_option_option_id_custom_field_option_id_fk",
"tableFrom": "issue_field_option",
"columnsFrom": [
"option_id"
],
"tableTo": "custom_field_option",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {
"issue_field_option_issue_id_field_id_option_id_pk": {
"name": "issue_field_option_issue_id_field_id_option_id_pk",
"columns": [
"issue_id",
"field_id",
"option_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.issue_field_value": {
"name": "issue_field_value",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"field_id": {
"name": "field_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"value_text": {
"name": "value_text",
"type": "text",
"primaryKey": false,
"notNull": false
},
"value_number": {
"name": "value_number",
"type": "numeric",
"primaryKey": false,
"notNull": false
},
"value_bool": {
"name": "value_bool",
"type": "boolean",
"primaryKey": false,
"notNull": false
},
"value_date": {
"name": "value_date",
"type": "date",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {
"issue_field_value_issue_id_issue_id_fk": {
"name": "issue_field_value_issue_id_issue_id_fk",
"tableFrom": "issue_field_value",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_field_value_field_id_custom_field_id_fk": {
"name": "issue_field_value_field_id_custom_field_id_fk",
"tableFrom": "issue_field_value",
"columnsFrom": [
"field_id"
],
"tableTo": "custom_field",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"issue_field_value_issue_id_field_id_unique": {
"name": "issue_field_value_issue_id_field_id_unique",
"columns": [
"issue_id",
"field_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.issue_label": {
"name": "issue_label",
"schema": "",
"columns": {
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"label_id": {
"name": "label_id",
"type": "integer",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"issue_label_issue_id_issue_id_fk": {
"name": "issue_label_issue_id_issue_id_fk",
"tableFrom": "issue_label",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"issue_label_label_id_label_id_fk": {
"name": "issue_label_label_id_label_id_fk",
"tableFrom": "issue_label",
"columnsFrom": [
"label_id"
],
"tableTo": "label",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {
"issue_label_issue_id_label_id_pk": {
"name": "issue_label_issue_id_label_id_pk",
"columns": [
"issue_id",
"label_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.issue_type": {
"name": "issue_type",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'#6b7280'"
},
"is_default": {
"name": "is_default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"issue_type_project_id_project_id_fk": {
"name": "issue_type_project_id_project_id_fk",
"tableFrom": "issue_type",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"issue_type_project_id_name_unique": {
"name": "issue_type_project_id_name_unique",
"columns": [
"project_id",
"name"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.label": {
"name": "label",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"group_id": {
"name": "group_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'#6b7280'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"label_project_id_project_id_fk": {
"name": "label_project_id_project_id_fk",
"tableFrom": "label",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"label_group_id_label_group_id_fk": {
"name": "label_group_id_label_group_id_fk",
"tableFrom": "label",
"columnsFrom": [
"group_id"
],
"tableTo": "label_group",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"label_project_id_name_unique": {
"name": "label_project_id_name_unique",
"columns": [
"project_id",
"name"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.label_group": {
"name": "label_group",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'#6b7280'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"label_group_project_id_project_id_fk": {
"name": "label_group_project_id_project_id_fk",
"tableFrom": "label_group",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"label_group_project_id_name_unique": {
"name": "label_group_project_id_name_unique",
"columns": [
"project_id",
"name"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.note_board": {
"name": "note_board",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"owner_user_id": {
"name": "owner_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_by_user_id": {
"name": "created_by_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"canvas": {
"name": "canvas",
"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": {
"note_board_project_idx": {
"name": "note_board_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "updated_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"note_board_project_id_project_id_fk": {
"name": "note_board_project_id_project_id_fk",
"tableFrom": "note_board",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"note_board_owner_user_id_user_id_fk": {
"name": "note_board_owner_user_id_user_id_fk",
"tableFrom": "note_board",
"columnsFrom": [
"owner_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"note_board_created_by_user_id_user_id_fk": {
"name": "note_board_created_by_user_id_user_id_fk",
"tableFrom": "note_board",
"columnsFrom": [
"created_by_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.notification": {
"name": "notification",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"issue_id": {
"name": "issue_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"source_activity_id": {
"name": "source_activity_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"type": {
"name": "type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"actor_user_id": {
"name": "actor_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"actor_name": {
"name": "actor_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"read_at": {
"name": "read_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"snoozed_until": {
"name": "snoozed_until",
"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": {
"notification_user_idx": {
"name": "notification_user_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "created_at",
"isExpression": false,
"asc": false,
"nulls": "last"
},
{
"expression": "id",
"isExpression": false,
"asc": false,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
},
"notification_user_unread_idx": {
"name": "notification_user_unread_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "id",
"isExpression": false,
"asc": false,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"where": "\"notification\".\"read_at\" IS NULL",
"concurrently": false
}
},
"foreignKeys": {
"notification_user_id_user_id_fk": {
"name": "notification_user_id_user_id_fk",
"tableFrom": "notification",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"notification_project_id_project_id_fk": {
"name": "notification_project_id_project_id_fk",
"tableFrom": "notification",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"notification_issue_id_issue_id_fk": {
"name": "notification_issue_id_issue_id_fk",
"tableFrom": "notification",
"columnsFrom": [
"issue_id"
],
"tableTo": "issue",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"notification_source_activity_id_issue_activity_id_fk": {
"name": "notification_source_activity_id_issue_activity_id_fk",
"tableFrom": "notification",
"columnsFrom": [
"source_activity_id"
],
"tableTo": "issue_activity",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"notification_actor_user_id_user_id_fk": {
"name": "notification_actor_user_id_user_id_fk",
"tableFrom": "notification",
"columnsFrom": [
"actor_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"notification_type_check": {
"name": "notification_type_check",
"value": "\"notification\".\"type\" IN ('assigned', 'mentioned', 'commented', 'state_changed')"
}
},
"isRLSEnabled": false
},
"public.notification_delivery": {
"name": "notification_delivery",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"channel": {
"name": "channel",
"type": "text",
"primaryKey": false,
"notNull": true
},
"recipient": {
"name": "recipient",
"type": "text",
"primaryKey": false,
"notNull": false
},
"payload": {
"name": "payload",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"attempts": {
"name": "attempts",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"next_attempt_at": {
"name": "next_attempt_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"notification_delivery_due_idx": {
"name": "notification_delivery_due_idx",
"columns": [
{
"expression": "next_attempt_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"where": "\"notification_delivery\".\"status\" = 'pending'",
"concurrently": false
}
},
"foreignKeys": {
"notification_delivery_project_id_project_id_fk": {
"name": "notification_delivery_project_id_project_id_fk",
"tableFrom": "notification_delivery",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"notification_delivery_channel_check": {
"name": "notification_delivery_channel_check",
"value": "\"notification_delivery\".\"channel\" IN ('email', 'telegram')"
}
},
"isRLSEnabled": false
},
"public.project": {
"name": "project",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"key": {
"name": "key",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"next_sequence": {
"name": "next_sequence",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 1
},
"mcp_enabled": {
"name": "mcp_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"initiatives_enabled": {
"name": "initiatives_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"dashboards_enabled": {
"name": "dashboards_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"notes_enabled": {
"name": "notes_enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"project_key_unique": {
"name": "project_key_unique",
"columns": [
"key"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.project_action": {
"name": "project_action",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"condition": {
"name": "condition",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"effect": {
"name": "effect",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"position": {
"name": "position",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"project_action_project_idx": {
"name": "project_action_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "position",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"project_action_project_id_project_id_fk": {
"name": "project_action_project_id_project_id_fk",
"tableFrom": "project_action",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.project_column": {
"name": "project_column",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"state_type": {
"name": "state_type",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'unstarted'"
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'#6b7280'"
},
"position": {
"name": "position",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"project_column_project_id_project_id_fk": {
"name": "project_column_project_id_project_id_fk",
"tableFrom": "project_column",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"project_column_project_id_position_unique": {
"name": "project_column_project_id_position_unique",
"columns": [
"project_id",
"position"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {
"project_column_state_type_check": {
"name": "project_column_state_type_check",
"value": "\"project_column\".\"state_type\" IN ('backlog', 'unstarted', 'started', 'completed', 'canceled')"
}
},
"isRLSEnabled": false
},
"public.project_dashboard": {
"name": "project_dashboard",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false
},
"layout": {
"name": "layout",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"position": {
"name": "position",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"project_dashboard_project_idx": {
"name": "project_dashboard_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "position",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"project_dashboard_project_id_project_id_fk": {
"name": "project_dashboard_project_id_project_id_fk",
"tableFrom": "project_dashboard",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.project_invite": {
"name": "project_invite",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"token": {
"name": "token",
"type": "uuid",
"primaryKey": false,
"notNull": true,
"default": "gen_random_uuid()"
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'member'"
},
"role_id": {
"name": "role_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"invited_by_user_id": {
"name": "invited_by_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"accepted_by_user_id": {
"name": "accepted_by_user_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"responded_at": {
"name": "responded_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
}
},
"indexes": {
"project_invite_pending_uq": {
"name": "project_invite_pending_uq",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "email",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"where": "\"project_invite\".\"status\" = 'pending'",
"concurrently": false
},
"project_invite_project_idx": {
"name": "project_invite_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"project_invite_project_id_project_id_fk": {
"name": "project_invite_project_id_project_id_fk",
"tableFrom": "project_invite",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"project_invite_role_id_project_role_id_fk": {
"name": "project_invite_role_id_project_role_id_fk",
"tableFrom": "project_invite",
"columnsFrom": [
"role_id"
],
"tableTo": "project_role",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"project_invite_invited_by_user_id_user_id_fk": {
"name": "project_invite_invited_by_user_id_user_id_fk",
"tableFrom": "project_invite",
"columnsFrom": [
"invited_by_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
},
"project_invite_accepted_by_user_id_user_id_fk": {
"name": "project_invite_accepted_by_user_id_user_id_fk",
"tableFrom": "project_invite",
"columnsFrom": [
"accepted_by_user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"project_invite_token_unique": {
"name": "project_invite_token_unique",
"columns": [
"token"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {
"project_invite_role_check": {
"name": "project_invite_role_check",
"value": "\"project_invite\".\"role\" IN ('owner', 'member')"
},
"project_invite_status_check": {
"name": "project_invite_status_check",
"value": "\"project_invite\".\"status\" IN ('pending', 'accepted', 'rejected')"
}
},
"isRLSEnabled": false
},
"public.project_member": {
"name": "project_member",
"schema": "",
"columns": {
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"role": {
"name": "role",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'member'"
},
"role_id": {
"name": "role_id",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "''"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"project_member_user_idx": {
"name": "project_member_user_idx",
"columns": [
{
"expression": "user_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"project_member_project_id_project_id_fk": {
"name": "project_member_project_id_project_id_fk",
"tableFrom": "project_member",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"project_member_user_id_user_id_fk": {
"name": "project_member_user_id_user_id_fk",
"tableFrom": "project_member",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"project_member_role_id_project_role_id_fk": {
"name": "project_member_role_id_project_role_id_fk",
"tableFrom": "project_member",
"columnsFrom": [
"role_id"
],
"tableTo": "project_role",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {
"project_member_project_id_user_id_pk": {
"name": "project_member_project_id_user_id_pk",
"columns": [
"project_id",
"user_id"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"project_member_role_check": {
"name": "project_member_role_check",
"value": "\"project_member\".\"role\" IN ('owner', 'member')"
}
},
"isRLSEnabled": false
},
"public.project_notification_setting": {
"name": "project_notification_setting",
"schema": "",
"columns": {
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": true,
"notNull": true
},
"ciphertext": {
"name": "ciphertext",
"type": "text",
"primaryKey": false,
"notNull": true
},
"iv": {
"name": "iv",
"type": "text",
"primaryKey": false,
"notNull": true
},
"auth_tag": {
"name": "auth_tag",
"type": "text",
"primaryKey": false,
"notNull": true
},
"redacted": {
"name": "redacted",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {
"project_notification_setting_project_id_project_id_fk": {
"name": "project_notification_setting_project_id_project_id_fk",
"tableFrom": "project_notification_setting",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.project_role": {
"name": "project_role",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"is_default": {
"name": "is_default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"permissions": {
"name": "permissions",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"project_role_default_uq": {
"name": "project_role_default_uq",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"where": "\"project_role\".\"is_default\"",
"concurrently": false
},
"project_role_project_idx": {
"name": "project_role_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"project_role_project_id_project_id_fk": {
"name": "project_role_project_id_project_id_fk",
"tableFrom": "project_role",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"project_role_project_id_name_unique": {
"name": "project_role_project_id_name_unique",
"columns": [
"project_id",
"name"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.project_setting": {
"name": "project_setting",
"schema": "",
"columns": {
"project_id": {
"name": "project_id",
"type": "integer",
"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": {
"project_setting_project_id_project_id_fk": {
"name": "project_setting_project_id_project_id_fk",
"tableFrom": "project_setting",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {
"project_setting_project_id_key_pk": {
"name": "project_setting_project_id_key_pk",
"columns": [
"project_id",
"key"
]
}
},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.project_view": {
"name": "project_view",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": false
},
"filters": {
"name": "filters",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"display": {
"name": "display",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"position": {
"name": "position",
"type": "double precision",
"primaryKey": false,
"notNull": true,
"default": 0
},
"share_token": {
"name": "share_token",
"type": "uuid",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"project_view_project_idx": {
"name": "project_view_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
},
{
"expression": "position",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"project_view_project_id_project_id_fk": {
"name": "project_view_project_id_project_id_fk",
"tableFrom": "project_view",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"project_view_share_token_unique": {
"name": "project_view_share_token_unique",
"columns": [
"share_token"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user_notification_preference": {
"name": "user_notification_preference",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"email_events": {
"name": "email_events",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'{}'::jsonb"
},
"telegram_events": {
"name": "telegram_events",
"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": {},
"foreignKeys": {
"user_notification_preference_user_id_user_id_fk": {
"name": "user_notification_preference_user_id_user_id_fk",
"tableFrom": "user_notification_preference",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"user_notification_preference_project_id_project_id_fk": {
"name": "user_notification_preference_project_id_project_id_fk",
"tableFrom": "user_notification_preference",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"user_notification_pref_user_project_unique": {
"name": "user_notification_pref_user_project_unique",
"columns": [
"user_id",
"project_id"
],
"nullsNotDistinct": false
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.user_preference": {
"name": "user_preference",
"schema": "",
"columns": {
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'UTC'"
},
"theme": {
"name": "theme",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'system'"
},
"issue_open_mode": {
"name": "issue_open_mode",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'panel'"
},
"start_page": {
"name": "start_page",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'work-items'"
},
"show_chat_by_default": {
"name": "show_chat_by_default",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"issue_stats_open": {
"name": "issue_stats_open",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"issue_stats_view": {
"name": "issue_stats_view",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'compact'"
},
"hotkeys": {
"name": "hotkeys",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"last_project_id": {
"name": "last_project_id",
"type": "integer",
"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": {},
"foreignKeys": {
"user_preference_user_id_user_id_fk": {
"name": "user_preference_user_id_user_id_fk",
"tableFrom": "user_preference",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
},
"user_preference_last_project_id_project_id_fk": {
"name": "user_preference_last_project_id_project_id_fk",
"tableFrom": "user_preference",
"columnsFrom": [
"last_project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "set null"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {
"user_preference_theme_check": {
"name": "user_preference_theme_check",
"value": "\"user_preference\".\"theme\" IN ('light', 'dark', 'system')"
},
"user_preference_issue_open_mode_check": {
"name": "user_preference_issue_open_mode_check",
"value": "\"user_preference\".\"issue_open_mode\" IN ('panel', 'page')"
},
"user_preference_start_page_check": {
"name": "user_preference_start_page_check",
"value": "\"user_preference\".\"start_page\" IN ('inbox', 'dashboard', 'work-items', 'initiatives', 'ai-chat')"
},
"user_preference_issue_stats_view_check": {
"name": "user_preference_issue_stats_view_check",
"value": "\"user_preference\".\"issue_stats_view\" IN ('compact', 'timeline')"
}
},
"isRLSEnabled": false
},
"public.user_telegram_account": {
"name": "user_telegram_account",
"schema": "",
"columns": {
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": true,
"notNull": true
},
"chat_id": {
"name": "chat_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"username": {
"name": "username",
"type": "text",
"primaryKey": false,
"notNull": false
},
"first_name": {
"name": "first_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"link_code": {
"name": "link_code",
"type": "text",
"primaryKey": false,
"notNull": false
},
"link_code_expires_at": {
"name": "link_code_expires_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"linked_at": {
"name": "linked_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": {
"user_telegram_account_chat_id_unique": {
"name": "user_telegram_account_chat_id_unique",
"columns": [
{
"expression": "chat_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"where": "\"user_telegram_account\".\"chat_id\" IS NOT NULL",
"concurrently": false
},
"user_telegram_account_link_code_unique": {
"name": "user_telegram_account_link_code_unique",
"columns": [
{
"expression": "link_code",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": true,
"with": {},
"method": "btree",
"where": "\"user_telegram_account\".\"link_code\" IS NOT NULL",
"concurrently": false
}
},
"foreignKeys": {
"user_telegram_account_user_id_user_id_fk": {
"name": "user_telegram_account_user_id_user_id_fk",
"tableFrom": "user_telegram_account",
"columnsFrom": [
"user_id"
],
"tableTo": "user",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.webhook": {
"name": "webhook",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"project_id": {
"name": "project_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"url": {
"name": "url",
"type": "text",
"primaryKey": false,
"notNull": true
},
"secret": {
"name": "secret",
"type": "text",
"primaryKey": false,
"notNull": true
},
"events": {
"name": "events",
"type": "jsonb",
"primaryKey": false,
"notNull": true,
"default": "'[]'::jsonb"
},
"is_active": {
"name": "is_active",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"consecutive_failures": {
"name": "consecutive_failures",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"webhook_project_idx": {
"name": "webhook_project_idx",
"columns": [
{
"expression": "project_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"webhook_project_id_project_id_fk": {
"name": "webhook_project_id_project_id_fk",
"tableFrom": "webhook",
"columnsFrom": [
"project_id"
],
"tableTo": "project",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.webhook_delivery": {
"name": "webhook_delivery",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "serial",
"primaryKey": true,
"notNull": true
},
"webhook_id": {
"name": "webhook_id",
"type": "integer",
"primaryKey": false,
"notNull": true
},
"event_id": {
"name": "event_id",
"type": "uuid",
"primaryKey": false,
"notNull": true
},
"event_type": {
"name": "event_type",
"type": "text",
"primaryKey": false,
"notNull": true
},
"payload": {
"name": "payload",
"type": "jsonb",
"primaryKey": false,
"notNull": true
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"attempts": {
"name": "attempts",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"next_attempt_at": {
"name": "next_attempt_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"response_status": {
"name": "response_status",
"type": "integer",
"primaryKey": false,
"notNull": false
},
"response_body": {
"name": "response_body",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"webhook_delivery_due_idx": {
"name": "webhook_delivery_due_idx",
"columns": [
{
"expression": "next_attempt_at",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"where": "\"webhook_delivery\".\"status\" = 'pending'",
"concurrently": false
},
"webhook_delivery_webhook_idx": {
"name": "webhook_delivery_webhook_idx",
"columns": [
{
"expression": "webhook_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"with": {},
"method": "btree",
"concurrently": false
}
},
"foreignKeys": {
"webhook_delivery_webhook_id_webhook_id_fk": {
"name": "webhook_delivery_webhook_id_webhook_id_fk",
"tableFrom": "webhook_delivery",
"columnsFrom": [
"webhook_id"
],
"tableTo": "webhook",
"columnsTo": [
"id"
],
"onUpdate": "no action",
"onDelete": "cascade"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"views": {},
"sequences": {},
"roles": {},
"policies": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}