@bettercms-ai/db 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +302 -10
- package/dist/index.js +235 -209
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22107,6 +22107,7 @@ __export(index_exports, {
|
|
|
22107
22107
|
projectsRelations: () => projectsRelations,
|
|
22108
22108
|
publishDeliveries: () => publishDeliveries,
|
|
22109
22109
|
publishItems: () => publishItems,
|
|
22110
|
+
publishValueOutcomes: () => publishValueOutcomes,
|
|
22110
22111
|
publishes: () => publishes,
|
|
22111
22112
|
qaReports: () => qaReports,
|
|
22112
22113
|
rebuildQueue: () => rebuildQueue,
|
|
@@ -25510,7 +25511,7 @@ var deployTargets = pgTable52(
|
|
|
25510
25511
|
);
|
|
25511
25512
|
|
|
25512
25513
|
// src/schema/publishes.ts
|
|
25513
|
-
import { pgTable as pgTable53, text as text54, varchar as varchar37, timestamp as timestamp49, index as index47 } from "drizzle-orm/pg-core";
|
|
25514
|
+
import { pgTable as pgTable53, text as text54, varchar as varchar37, timestamp as timestamp49, index as index47, uniqueIndex as uniqueIndex21, jsonb as jsonb27 } from "drizzle-orm/pg-core";
|
|
25514
25515
|
var publishes = pgTable53(
|
|
25515
25516
|
"publishes",
|
|
25516
25517
|
{
|
|
@@ -25583,9 +25584,33 @@ var publishDeliveries = pgTable53(
|
|
|
25583
25584
|
index47("publish_deliveries_open_idx").on(t.projectId, t.host, t.status)
|
|
25584
25585
|
]
|
|
25585
25586
|
);
|
|
25587
|
+
var publishValueOutcomes = pgTable53(
|
|
25588
|
+
"publish_value_outcomes",
|
|
25589
|
+
{
|
|
25590
|
+
id: text54("id").primaryKey(),
|
|
25591
|
+
publishId: text54("publish_id").notNull(),
|
|
25592
|
+
workspaceId: text54("workspace_id").notNull(),
|
|
25593
|
+
projectId: text54("project_id").notNull(),
|
|
25594
|
+
route: text54("route").notNull(),
|
|
25595
|
+
address: text54("address").notNull(),
|
|
25596
|
+
kind: varchar37("kind", { length: 16 }).notNull(),
|
|
25597
|
+
/** live | held | refused | unverified */
|
|
25598
|
+
state: varchar37("state", { length: 16 }).notNull(),
|
|
25599
|
+
/** The machine code of a row that is not live; a DB CHECK requires it there. */
|
|
25600
|
+
reason: varchar37("reason", { length: 48 }),
|
|
25601
|
+
actionJson: jsonb27("action_json"),
|
|
25602
|
+
evidenceJson: jsonb27("evidence_json"),
|
|
25603
|
+
checkedAt: timestamp49("checked_at", { withTimezone: true }).notNull().defaultNow(),
|
|
25604
|
+
createdAt: timestamp49("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
25605
|
+
},
|
|
25606
|
+
(t) => [
|
|
25607
|
+
uniqueIndex21("publish_value_outcomes_value_idx").on(t.publishId, t.route, t.address),
|
|
25608
|
+
index47("publish_value_outcomes_route_idx").on(t.projectId, t.route)
|
|
25609
|
+
]
|
|
25610
|
+
);
|
|
25586
25611
|
|
|
25587
25612
|
// src/schema/hosting_connections.ts
|
|
25588
|
-
import { pgTable as pgTable54, text as text55, varchar as varchar38, timestamp as timestamp50, index as index48, uniqueIndex as
|
|
25613
|
+
import { pgTable as pgTable54, text as text55, varchar as varchar38, timestamp as timestamp50, index as index48, uniqueIndex as uniqueIndex22 } from "drizzle-orm/pg-core";
|
|
25589
25614
|
import { sql as sql11 } from "drizzle-orm";
|
|
25590
25615
|
var hostingConnections = pgTable54(
|
|
25591
25616
|
"hosting_connections",
|
|
@@ -25624,12 +25649,12 @@ var hostingConnections = pgTable54(
|
|
|
25624
25649
|
(t) => [
|
|
25625
25650
|
index48("hosting_connections_workspace_idx").on(t.workspaceId),
|
|
25626
25651
|
// Reconnecting the same account UPDATEs rather than accumulating a second live credential.
|
|
25627
|
-
|
|
25652
|
+
uniqueIndex22("hosting_connections_account_unique").on(t.workspaceId, t.provider, t.accountId).where(sql11`deleted_at IS NULL`)
|
|
25628
25653
|
]
|
|
25629
25654
|
);
|
|
25630
25655
|
|
|
25631
25656
|
// src/schema/external_deployments.ts
|
|
25632
|
-
import { pgTable as pgTable55, text as text56, varchar as varchar39, integer as integer23, timestamp as timestamp51, index as index49, uniqueIndex as
|
|
25657
|
+
import { pgTable as pgTable55, text as text56, varchar as varchar39, integer as integer23, timestamp as timestamp51, index as index49, uniqueIndex as uniqueIndex23 } from "drizzle-orm/pg-core";
|
|
25633
25658
|
import { sql as sql12 } from "drizzle-orm";
|
|
25634
25659
|
var externalDeployments = pgTable55(
|
|
25635
25660
|
"external_deployments",
|
|
@@ -25676,12 +25701,12 @@ var externalDeployments = pgTable55(
|
|
|
25676
25701
|
* Git-mode rows have sha NULL and are therefore NOT covered — NULLs never conflict — which is
|
|
25677
25702
|
* correct: a git deploy carries no artifact identity, so two publishes are two real builds.
|
|
25678
25703
|
*/
|
|
25679
|
-
|
|
25704
|
+
uniqueIndex23("external_deployments_inflight_unique").on(t.targetId, t.sha).where(sql12`state IN ('queued', 'deploying')`)
|
|
25680
25705
|
]
|
|
25681
25706
|
);
|
|
25682
25707
|
|
|
25683
25708
|
// src/schema/page_types.ts
|
|
25684
|
-
import { pgTable as pgTable56, text as text57, varchar as varchar40, jsonb as
|
|
25709
|
+
import { pgTable as pgTable56, text as text57, varchar as varchar40, jsonb as jsonb28, index as index50, uniqueIndex as uniqueIndex24 } from "drizzle-orm/pg-core";
|
|
25685
25710
|
var pageTypes = pgTable56(
|
|
25686
25711
|
"page_types",
|
|
25687
25712
|
{
|
|
@@ -25692,8 +25717,8 @@ var pageTypes = pgTable56(
|
|
|
25692
25717
|
slug: varchar40("slug", { length: 255 }).notNull(),
|
|
25693
25718
|
/** Same ContentModelField[] shape `pages.fields` holds — a type exists so several pages
|
|
25694
25719
|
* can SHARE one schema instead of each carrying a copy. */
|
|
25695
|
-
fields:
|
|
25696
|
-
routingJson:
|
|
25720
|
+
fields: jsonb28("fields").$type().notNull().default([]),
|
|
25721
|
+
routingJson: jsonb28("routing_json").$type(),
|
|
25697
25722
|
...branchColumns,
|
|
25698
25723
|
...auditColumns,
|
|
25699
25724
|
...softDeleteColumn
|
|
@@ -25701,12 +25726,12 @@ var pageTypes = pgTable56(
|
|
|
25701
25726
|
(t) => [
|
|
25702
25727
|
index50("page_types_project_idx").on(t.projectId),
|
|
25703
25728
|
index50("page_types_workspace_idx").on(t.workspaceId),
|
|
25704
|
-
|
|
25729
|
+
uniqueIndex24("page_types_project_slug_unique").on(t.projectId, t.branchId, t.slug)
|
|
25705
25730
|
]
|
|
25706
25731
|
);
|
|
25707
25732
|
|
|
25708
25733
|
// src/schema/build_triggers.ts
|
|
25709
|
-
import { pgTable as pgTable57, text as text58, varchar as varchar41, boolean as boolean26, timestamp as timestamp53, integer as integer24, jsonb as
|
|
25734
|
+
import { pgTable as pgTable57, text as text58, varchar as varchar41, boolean as boolean26, timestamp as timestamp53, integer as integer24, jsonb as jsonb29, index as index51, uniqueIndex as uniqueIndex25 } from "drizzle-orm/pg-core";
|
|
25710
25735
|
var BUILD_TRIGGER_KINDS = ["webhook", "content", "schedule"];
|
|
25711
25736
|
var buildTriggers = pgTable57(
|
|
25712
25737
|
"build_triggers",
|
|
@@ -25728,7 +25753,7 @@ var buildTriggers = pgTable57(
|
|
|
25728
25753
|
prevSecretEnc: text58("prev_secret_enc"),
|
|
25729
25754
|
prevSecretExpiresAt: timestamp53("prev_secret_expires_at"),
|
|
25730
25755
|
/** `[]` = every publish. Model SLUGS, not ids — ids break across a model rebuild. */
|
|
25731
|
-
contentScopes:
|
|
25756
|
+
contentScopes: jsonb29("content_scopes").$type().notNull().default([]),
|
|
25732
25757
|
schedule: varchar41("schedule", { length: 120 }),
|
|
25733
25758
|
/** IANA zone. "Rebuild at 9am" means 9am where the customer is. */
|
|
25734
25759
|
timezone: varchar41("timezone", { length: 64 }).notNull().default("UTC"),
|
|
@@ -25741,7 +25766,7 @@ var buildTriggers = pgTable57(
|
|
|
25741
25766
|
(t) => [
|
|
25742
25767
|
index51("build_triggers_project_idx").on(t.projectId),
|
|
25743
25768
|
index51("build_triggers_workspace_idx").on(t.workspaceId),
|
|
25744
|
-
|
|
25769
|
+
uniqueIndex25("build_triggers_project_name_unique").on(t.projectId, t.name)
|
|
25745
25770
|
]
|
|
25746
25771
|
);
|
|
25747
25772
|
var buildTriggerRuns = pgTable57(
|
|
@@ -25804,7 +25829,7 @@ var generatedTypes = pgTable59("generated_types", {
|
|
|
25804
25829
|
});
|
|
25805
25830
|
|
|
25806
25831
|
// src/schema/agent_keys.ts
|
|
25807
|
-
import { pgTable as pgTable60, text as text61, uniqueIndex as
|
|
25832
|
+
import { pgTable as pgTable60, text as text61, uniqueIndex as uniqueIndex26 } from "drizzle-orm/pg-core";
|
|
25808
25833
|
var agentKeys = pgTable60(
|
|
25809
25834
|
"agent_keys",
|
|
25810
25835
|
{
|
|
@@ -25816,11 +25841,11 @@ var agentKeys = pgTable60(
|
|
|
25816
25841
|
// AES-256-GCM encrypted
|
|
25817
25842
|
...auditColumns
|
|
25818
25843
|
},
|
|
25819
|
-
(t) => [
|
|
25844
|
+
(t) => [uniqueIndex26("agent_keys_workspace_unique").on(t.workspaceId)]
|
|
25820
25845
|
);
|
|
25821
25846
|
|
|
25822
25847
|
// src/schema/ai_provider_keys.ts
|
|
25823
|
-
import { pgTable as pgTable61, text as text62, varchar as varchar44, uniqueIndex as
|
|
25848
|
+
import { pgTable as pgTable61, text as text62, varchar as varchar44, uniqueIndex as uniqueIndex27 } from "drizzle-orm/pg-core";
|
|
25824
25849
|
var aiProviderKeys = pgTable61(
|
|
25825
25850
|
"ai_provider_keys",
|
|
25826
25851
|
{
|
|
@@ -25834,11 +25859,11 @@ var aiProviderKeys = pgTable61(
|
|
|
25834
25859
|
keyHint: varchar44("key_hint", { length: 8 }).notNull(),
|
|
25835
25860
|
...auditColumns
|
|
25836
25861
|
},
|
|
25837
|
-
(t) => [
|
|
25862
|
+
(t) => [uniqueIndex27("ai_provider_keys_workspace_provider_key").on(t.workspaceId, t.provider)]
|
|
25838
25863
|
);
|
|
25839
25864
|
|
|
25840
25865
|
// src/schema/agent_sessions.ts
|
|
25841
|
-
import { pgTable as pgTable62, text as text63, varchar as varchar45, timestamp as timestamp56, doublePrecision, jsonb as
|
|
25866
|
+
import { pgTable as pgTable62, text as text63, varchar as varchar45, timestamp as timestamp56, doublePrecision, jsonb as jsonb30, index as index52 } from "drizzle-orm/pg-core";
|
|
25842
25867
|
var agentSessions = pgTable62(
|
|
25843
25868
|
"agent_sessions",
|
|
25844
25869
|
{
|
|
@@ -25879,7 +25904,7 @@ var agentMessages = pgTable62(
|
|
|
25879
25904
|
sessionId: text63("session_id").notNull(),
|
|
25880
25905
|
role: varchar45("role", { length: 16 }).notNull(),
|
|
25881
25906
|
// user | assistant | tool
|
|
25882
|
-
content:
|
|
25907
|
+
content: jsonb30("content").notNull(),
|
|
25883
25908
|
// { text? , toolName?, toolInput?, toolResult? ... }
|
|
25884
25909
|
createdAt: timestamp56("created_at").notNull().defaultNow()
|
|
25885
25910
|
},
|
|
@@ -25887,7 +25912,7 @@ var agentMessages = pgTable62(
|
|
|
25887
25912
|
);
|
|
25888
25913
|
|
|
25889
25914
|
// src/schema/agent_instructions.ts
|
|
25890
|
-
import { pgTable as pgTable63, text as text64, varchar as varchar46, boolean as boolean27, jsonb as
|
|
25915
|
+
import { pgTable as pgTable63, text as text64, varchar as varchar46, boolean as boolean27, jsonb as jsonb31, timestamp as timestamp57, index as index53, check as check2 } from "drizzle-orm/pg-core";
|
|
25891
25916
|
import { sql as sql13 } from "drizzle-orm";
|
|
25892
25917
|
var INSTRUCTION_KINDS = ["skill", "rule"];
|
|
25893
25918
|
var INSTRUCTION_SOURCES = ["template", "manual", "import"];
|
|
@@ -25907,7 +25932,7 @@ var agentInstructions = pgTable63(
|
|
|
25907
25932
|
/** Master switch. Off = ignored everywhere, regardless of `disabledFor`. */
|
|
25908
25933
|
enabled: boolean27("enabled").notNull().default(true),
|
|
25909
25934
|
/** Project ids that opted OUT. Workspace-wide by default, scoped by exception. */
|
|
25910
|
-
disabledFor:
|
|
25935
|
+
disabledFor: jsonb31("disabled_for").$type().notNull().default([]),
|
|
25911
25936
|
source: varchar46("source", { length: 16 }).$type().notNull().default("manual"),
|
|
25912
25937
|
templateId: varchar46("template_id", { length: 64 }),
|
|
25913
25938
|
// set when source === "template"
|
|
@@ -25935,11 +25960,11 @@ import {
|
|
|
25935
25960
|
check as check3,
|
|
25936
25961
|
index as index54,
|
|
25937
25962
|
integer as integer26,
|
|
25938
|
-
jsonb as
|
|
25963
|
+
jsonb as jsonb32,
|
|
25939
25964
|
pgTable as pgTable64,
|
|
25940
25965
|
text as text65,
|
|
25941
25966
|
timestamp as timestamp58,
|
|
25942
|
-
uniqueIndex as
|
|
25967
|
+
uniqueIndex as uniqueIndex28,
|
|
25943
25968
|
varchar as varchar47
|
|
25944
25969
|
} from "drizzle-orm/pg-core";
|
|
25945
25970
|
import { sql as sql14 } from "drizzle-orm";
|
|
@@ -25969,7 +25994,7 @@ var customAgents = pgTable64(
|
|
|
25969
25994
|
archivedAt: timestamp58("archived_at", { withTimezone: true })
|
|
25970
25995
|
},
|
|
25971
25996
|
(table) => [
|
|
25972
|
-
|
|
25997
|
+
uniqueIndex28("custom_agents_workspace_slug_unique").on(table.workspaceId, table.slug),
|
|
25973
25998
|
index54("custom_agents_workspace_status_idx").on(table.workspaceId, table.status, table.updatedAt),
|
|
25974
25999
|
index54("custom_agents_project_status_idx").on(table.projectId, table.status, table.updatedAt),
|
|
25975
26000
|
check3("custom_agents_status_check", sql14`${table.status} IN ('active', 'archived')`),
|
|
@@ -25986,14 +26011,14 @@ var customAgentRevisions = pgTable64(
|
|
|
25986
26011
|
version: integer26("version").notNull(),
|
|
25987
26012
|
instructions: text65("instructions").notNull(),
|
|
25988
26013
|
speed: varchar47("speed", { length: 16 }).$type().notNull().default("balanced"),
|
|
25989
|
-
capabilities:
|
|
26014
|
+
capabilities: jsonb32("capabilities").$type().notNull().default([]),
|
|
25990
26015
|
reviewPolicy: varchar47("review_policy", { length: 24 }).notNull().default("draft_only"),
|
|
25991
26016
|
configDigest: varchar47("config_digest", { length: 64 }).notNull(),
|
|
25992
26017
|
createdBy: text65("created_by"),
|
|
25993
26018
|
createdAt: timestamp58("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
25994
26019
|
},
|
|
25995
26020
|
(table) => [
|
|
25996
|
-
|
|
26021
|
+
uniqueIndex28("custom_agent_revisions_agent_version_unique").on(table.agentId, table.version),
|
|
25997
26022
|
index54("custom_agent_revisions_workspace_agent_idx").on(table.workspaceId, table.agentId),
|
|
25998
26023
|
check3("custom_agent_revisions_version_check", sql14`${table.version} > 0`),
|
|
25999
26024
|
check3("custom_agent_revisions_speed_check", sql14`${table.speed} IN ('lite', 'balanced', 'max')`),
|
|
@@ -26032,7 +26057,7 @@ var customAgentRuns = pgTable64(
|
|
|
26032
26057
|
updatedAt: timestamp58("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
26033
26058
|
},
|
|
26034
26059
|
(table) => [
|
|
26035
|
-
|
|
26060
|
+
uniqueIndex28("custom_agent_runs_agent_idempotency_unique").on(table.agentId, table.idempotencyKey),
|
|
26036
26061
|
index54("custom_agent_runs_agent_created_idx").on(table.agentId, table.createdAt),
|
|
26037
26062
|
index54("custom_agent_runs_workspace_status_idx").on(table.workspaceId, table.status, table.createdAt),
|
|
26038
26063
|
index54("custom_agent_runs_project_status_idx").on(table.projectId, table.status, table.createdAt),
|
|
@@ -26047,7 +26072,7 @@ var customAgentRuns = pgTable64(
|
|
|
26047
26072
|
);
|
|
26048
26073
|
|
|
26049
26074
|
// src/schema/ai_generation_jobs.ts
|
|
26050
|
-
import { pgTable as pgTable65, text as text66, varchar as varchar48, integer as integer27, jsonb as
|
|
26075
|
+
import { pgTable as pgTable65, text as text66, varchar as varchar48, integer as integer27, jsonb as jsonb33, timestamp as timestamp59, index as index55 } from "drizzle-orm/pg-core";
|
|
26051
26076
|
var aiGenerationJobs = pgTable65(
|
|
26052
26077
|
"ai_generation_jobs",
|
|
26053
26078
|
{
|
|
@@ -26063,9 +26088,9 @@ var aiGenerationJobs = pgTable65(
|
|
|
26063
26088
|
// Durable because the drain runs after the request connection (and its GUCs) is gone.
|
|
26064
26089
|
// AI-produced content is always an agent write, even when a human queued the job.
|
|
26065
26090
|
writeOrigin: text66("write_origin").$type().notNull().default("agent:tab"),
|
|
26066
|
-
mapping:
|
|
26091
|
+
mapping: jsonb33("mapping").notNull(),
|
|
26067
26092
|
// GenerateMapping (generate) | { contentModelId } (seo)
|
|
26068
|
-
rows:
|
|
26093
|
+
rows: jsonb33("rows").notNull(),
|
|
26069
26094
|
/**
|
|
26070
26095
|
* needs_approval | queued | running | done | failed
|
|
26071
26096
|
*
|
|
@@ -26084,7 +26109,7 @@ var aiGenerationJobs = pgTable65(
|
|
|
26084
26109
|
* scope/estimate that is approved is the scope/estimate that runs. Null on jobs that never
|
|
26085
26110
|
* needed approval. Mirrors the migration_jobs.plan precedent.
|
|
26086
26111
|
*/
|
|
26087
|
-
plan:
|
|
26112
|
+
plan: jsonb33("plan"),
|
|
26088
26113
|
total: integer27("total").notNull().default(0),
|
|
26089
26114
|
processed: integer27("processed").notNull().default(0),
|
|
26090
26115
|
cursor: integer27("cursor").notNull().default(0),
|
|
@@ -26105,7 +26130,7 @@ var aiGenerationJobs = pgTable65(
|
|
|
26105
26130
|
* Per-row outcomes for rows that did NOT produce an entry, so `processed = created + failed +
|
|
26106
26131
|
* skipped` is explainable. `[{ row, status, reason, detail? }]` — see lib/generate/reasons.ts.
|
|
26107
26132
|
*/
|
|
26108
|
-
rowResults:
|
|
26133
|
+
rowResults: jsonb33("row_results").notNull().default([]),
|
|
26109
26134
|
/** Phase 1 ABM campaign this job belongs to. Null on every SEO/rename/migrate job. */
|
|
26110
26135
|
campaignId: text66("campaign_id"),
|
|
26111
26136
|
/**
|
|
@@ -26133,7 +26158,7 @@ var previewTokenRevocations = pgTable66("preview_token_revocations", {
|
|
|
26133
26158
|
});
|
|
26134
26159
|
|
|
26135
26160
|
// src/schema/abm_campaigns.ts
|
|
26136
|
-
import { index as index56, integer as integer28, jsonb as
|
|
26161
|
+
import { index as index56, integer as integer28, jsonb as jsonb34, pgTable as pgTable67, text as text68, timestamp as timestamp61, varchar as varchar49 } from "drizzle-orm/pg-core";
|
|
26137
26162
|
var abmCampaigns = pgTable67(
|
|
26138
26163
|
"abm_campaigns",
|
|
26139
26164
|
{
|
|
@@ -26148,7 +26173,7 @@ var abmCampaigns = pgTable67(
|
|
|
26148
26173
|
kind: varchar49("kind", { length: 16 }).notNull().default("abm"),
|
|
26149
26174
|
/** draft | generating | review | scheduled | live | expired | failed */
|
|
26150
26175
|
status: varchar49("status", { length: 16 }).notNull().default("draft"),
|
|
26151
|
-
options:
|
|
26176
|
+
options: jsonb34("options").$type().notNull().default({}),
|
|
26152
26177
|
scheduledAt: timestamp61("scheduled_at", { withTimezone: true }),
|
|
26153
26178
|
unpublishAt: timestamp61("unpublish_at", { withTimezone: true }),
|
|
26154
26179
|
creditsSpent: integer28("credits_spent").notNull().default(0),
|
|
@@ -26184,7 +26209,7 @@ var abmShareTokens = pgTable68(
|
|
|
26184
26209
|
);
|
|
26185
26210
|
|
|
26186
26211
|
// src/schema/mcp_tasks.ts
|
|
26187
|
-
import { check as check4, index as index58, integer as integer30, jsonb as
|
|
26212
|
+
import { check as check4, index as index58, integer as integer30, jsonb as jsonb35, pgTable as pgTable69, text as text70, timestamp as timestamp63, uniqueIndex as uniqueIndex29, varchar as varchar51 } from "drizzle-orm/pg-core";
|
|
26188
26213
|
import { sql as sql15 } from "drizzle-orm";
|
|
26189
26214
|
var MCP_TASK_STATUSES = [
|
|
26190
26215
|
"working",
|
|
@@ -26205,8 +26230,8 @@ var mcpTasks = pgTable69(
|
|
|
26205
26230
|
aiJobId: text70("ai_job_id"),
|
|
26206
26231
|
status: varchar51("status", { length: 24 }).$type().notNull().default("working"),
|
|
26207
26232
|
statusMessage: text70("status_message"),
|
|
26208
|
-
inputState:
|
|
26209
|
-
finalResult:
|
|
26233
|
+
inputState: jsonb35("input_state").$type().notNull().default({}),
|
|
26234
|
+
finalResult: jsonb35("final_result").$type(),
|
|
26210
26235
|
ttlMs: integer30("ttl_ms"),
|
|
26211
26236
|
pollIntervalMs: integer30("poll_interval_ms").notNull().default(2e3),
|
|
26212
26237
|
cancelRequestedAt: timestamp63("cancel_requested_at"),
|
|
@@ -26215,7 +26240,7 @@ var mcpTasks = pgTable69(
|
|
|
26215
26240
|
updatedAt: timestamp63("updated_at").notNull().defaultNow()
|
|
26216
26241
|
},
|
|
26217
26242
|
(table) => [
|
|
26218
|
-
|
|
26243
|
+
uniqueIndex29("mcp_tasks_ai_job_uidx").on(table.aiJobId).where(sql15`${table.aiJobId} IS NOT NULL`),
|
|
26219
26244
|
index58("mcp_tasks_principal_idx").on(
|
|
26220
26245
|
table.workspaceId,
|
|
26221
26246
|
table.projectId,
|
|
@@ -26246,7 +26271,7 @@ var mcpTasks = pgTable69(
|
|
|
26246
26271
|
);
|
|
26247
26272
|
|
|
26248
26273
|
// src/schema/seo_reports.ts
|
|
26249
|
-
import { pgTable as pgTable70, text as text71, date, jsonb as
|
|
26274
|
+
import { pgTable as pgTable70, text as text71, date, jsonb as jsonb36, timestamp as timestamp64, uniqueIndex as uniqueIndex30, index as index59 } from "drizzle-orm/pg-core";
|
|
26250
26275
|
var seoReports = pgTable70(
|
|
26251
26276
|
"seo_reports",
|
|
26252
26277
|
{
|
|
@@ -26256,19 +26281,19 @@ var seoReports = pgTable70(
|
|
|
26256
26281
|
projectId: text71("project_id").notNull(),
|
|
26257
26282
|
periodStart: date("period_start").notNull(),
|
|
26258
26283
|
periodEnd: date("period_end").notNull(),
|
|
26259
|
-
metricsJson:
|
|
26284
|
+
metricsJson: jsonb36("metrics_json").$type().notNull(),
|
|
26260
26285
|
summary: text71("summary").notNull(),
|
|
26261
26286
|
createdAt: timestamp64("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
26262
26287
|
},
|
|
26263
26288
|
(t) => [
|
|
26264
26289
|
// Idempotency guard: one report per period (matches the per-minute cron).
|
|
26265
|
-
|
|
26290
|
+
uniqueIndex30("seo_reports_project_period_idx").on(t.projectId, t.periodStart, t.periodEnd),
|
|
26266
26291
|
index59("seo_reports_project_created_idx").on(t.projectId, t.createdAt)
|
|
26267
26292
|
]
|
|
26268
26293
|
);
|
|
26269
26294
|
|
|
26270
26295
|
// src/schema/qa_reports.ts
|
|
26271
|
-
import { pgTable as pgTable71, text as text72, integer as integer31, jsonb as
|
|
26296
|
+
import { pgTable as pgTable71, text as text72, integer as integer31, jsonb as jsonb37, timestamp as timestamp65, index as index60 } from "drizzle-orm/pg-core";
|
|
26272
26297
|
var qaReports = pgTable71(
|
|
26273
26298
|
"qa_reports",
|
|
26274
26299
|
{
|
|
@@ -26276,7 +26301,7 @@ var qaReports = pgTable71(
|
|
|
26276
26301
|
// nanoid
|
|
26277
26302
|
workspaceId: text72("workspace_id").notNull(),
|
|
26278
26303
|
projectId: text72("project_id").notNull(),
|
|
26279
|
-
findingsJson:
|
|
26304
|
+
findingsJson: jsonb37("findings_json").$type().notNull(),
|
|
26280
26305
|
summary: text72("summary").notNull(),
|
|
26281
26306
|
criticalCount: integer31("critical_count").notNull().default(0),
|
|
26282
26307
|
createdAt: timestamp65("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
@@ -26285,7 +26310,7 @@ var qaReports = pgTable71(
|
|
|
26285
26310
|
);
|
|
26286
26311
|
|
|
26287
26312
|
// src/schema/webflow_integrations.ts
|
|
26288
|
-
import { pgTable as pgTable72, text as text73, varchar as varchar52, jsonb as
|
|
26313
|
+
import { pgTable as pgTable72, text as text73, varchar as varchar52, jsonb as jsonb38, timestamp as timestamp66, index as index61 } from "drizzle-orm/pg-core";
|
|
26289
26314
|
var webflowIntegrations = pgTable72(
|
|
26290
26315
|
"webflow_integrations",
|
|
26291
26316
|
{
|
|
@@ -26299,7 +26324,7 @@ var webflowIntegrations = pgTable72(
|
|
|
26299
26324
|
// display only; may be absent
|
|
26300
26325
|
accessToken: text73("access_token").notNull(),
|
|
26301
26326
|
// encrypted at rest
|
|
26302
|
-
scopes:
|
|
26327
|
+
scopes: jsonb38("scopes").$type().notNull().default([]),
|
|
26303
26328
|
connectedBy: text73("connected_by"),
|
|
26304
26329
|
// FK → users.id
|
|
26305
26330
|
createdAt: timestamp66("created_at").notNull().defaultNow(),
|
|
@@ -26309,7 +26334,7 @@ var webflowIntegrations = pgTable72(
|
|
|
26309
26334
|
);
|
|
26310
26335
|
|
|
26311
26336
|
// src/schema/migration_jobs.ts
|
|
26312
|
-
import { pgTable as pgTable73, text as text74, varchar as varchar53, integer as integer32, jsonb as
|
|
26337
|
+
import { pgTable as pgTable73, text as text74, varchar as varchar53, integer as integer32, jsonb as jsonb39, timestamp as timestamp67, index as index62 } from "drizzle-orm/pg-core";
|
|
26313
26338
|
var migrationJobs = pgTable73(
|
|
26314
26339
|
"migration_jobs",
|
|
26315
26340
|
{
|
|
@@ -26322,11 +26347,11 @@ var migrationJobs = pgTable73(
|
|
|
26322
26347
|
// webflow | framer
|
|
26323
26348
|
framework: varchar53("framework", { length: 16 }).notNull().default("astro"),
|
|
26324
26349
|
// astro | next
|
|
26325
|
-
plan:
|
|
26350
|
+
plan: jsonb39("plan").notNull(),
|
|
26326
26351
|
// MigrationPlan (user-confirmed mapping)
|
|
26327
|
-
graph:
|
|
26352
|
+
graph: jsonb39("graph"),
|
|
26328
26353
|
// reserved for a future per-phase checkpoint — NOT written today
|
|
26329
|
-
report:
|
|
26354
|
+
report: jsonb39("report"),
|
|
26330
26355
|
// MigrationReport, written once when the job reaches done | failed
|
|
26331
26356
|
// queued | crawling | binding | seeding | media | repo | done | failed
|
|
26332
26357
|
status: varchar53("status", { length: 16 }).notNull().default("queued"),
|
|
@@ -26346,7 +26371,7 @@ var migrationJobs = pgTable73(
|
|
|
26346
26371
|
);
|
|
26347
26372
|
|
|
26348
26373
|
// src/schema/ai_reports.ts
|
|
26349
|
-
import { pgTable as pgTable74, text as text75, varchar as varchar54, jsonb as
|
|
26374
|
+
import { pgTable as pgTable74, text as text75, varchar as varchar54, jsonb as jsonb40, timestamp as timestamp68, index as index63 } from "drizzle-orm/pg-core";
|
|
26350
26375
|
var aiReports = pgTable74(
|
|
26351
26376
|
"ai_reports",
|
|
26352
26377
|
{
|
|
@@ -26355,7 +26380,7 @@ var aiReports = pgTable74(
|
|
|
26355
26380
|
workspaceId: text75("workspace_id").notNull(),
|
|
26356
26381
|
projectId: text75("project_id").notNull(),
|
|
26357
26382
|
kind: varchar54("kind", { length: 16 }).$type().notNull(),
|
|
26358
|
-
findingsJson:
|
|
26383
|
+
findingsJson: jsonb40("findings_json").$type().notNull(),
|
|
26359
26384
|
summary: text75("summary").notNull(),
|
|
26360
26385
|
createdAt: timestamp68("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
26361
26386
|
},
|
|
@@ -26373,7 +26398,7 @@ import {
|
|
|
26373
26398
|
bigint as bigint3,
|
|
26374
26399
|
smallint,
|
|
26375
26400
|
index as index64,
|
|
26376
|
-
uniqueIndex as
|
|
26401
|
+
uniqueIndex as uniqueIndex31,
|
|
26377
26402
|
primaryKey as primaryKey4
|
|
26378
26403
|
} from "drizzle-orm/pg-core";
|
|
26379
26404
|
import { sql as sql16 } from "drizzle-orm";
|
|
@@ -26411,7 +26436,7 @@ var analyticsEventsRaw = pgTable75(
|
|
|
26411
26436
|
index64("analytics_events_raw_project_ts_idx").on(t.projectId, t.ts),
|
|
26412
26437
|
index64("analytics_events_raw_ts_idx").on(t.ts),
|
|
26413
26438
|
// Partial, so the nginx path (event_id NULL) is unconstrained and unchanged.
|
|
26414
|
-
|
|
26439
|
+
uniqueIndex31("analytics_events_raw_event_id_uidx").on(t.eventId).where(sql16`${t.eventId} IS NOT NULL`)
|
|
26415
26440
|
]
|
|
26416
26441
|
);
|
|
26417
26442
|
var analyticsDailyTotals = pgTable75(
|
|
@@ -26488,7 +26513,7 @@ var analyticsCursor = pgTable75("analytics_cursor", {
|
|
|
26488
26513
|
});
|
|
26489
26514
|
|
|
26490
26515
|
// src/schema/site_files.ts
|
|
26491
|
-
import { pgTable as pgTable76, text as text77, varchar as varchar56, integer as integer34, timestamp as timestamp70, uniqueIndex as
|
|
26516
|
+
import { pgTable as pgTable76, text as text77, varchar as varchar56, integer as integer34, timestamp as timestamp70, uniqueIndex as uniqueIndex32 } from "drizzle-orm/pg-core";
|
|
26492
26517
|
var SITE_FILE_KINDS = ["llms.txt", "llms-full.txt"];
|
|
26493
26518
|
var siteFiles = pgTable76(
|
|
26494
26519
|
"site_files",
|
|
@@ -26506,11 +26531,11 @@ var siteFiles = pgTable76(
|
|
|
26506
26531
|
createdAt: timestamp70("created_at").notNull().defaultNow(),
|
|
26507
26532
|
updatedAt: timestamp70("updated_at").notNull().defaultNow()
|
|
26508
26533
|
},
|
|
26509
|
-
(t) => [
|
|
26534
|
+
(t) => [uniqueIndex32("site_files_project_kind_idx").on(t.projectId, t.kind)]
|
|
26510
26535
|
);
|
|
26511
26536
|
|
|
26512
26537
|
// src/schema/indexnow_submissions.ts
|
|
26513
|
-
import { pgTable as pgTable77, text as text78, varchar as varchar57, integer as integer35, jsonb as
|
|
26538
|
+
import { pgTable as pgTable77, text as text78, varchar as varchar57, integer as integer35, jsonb as jsonb41, timestamp as timestamp71, index as index65 } from "drizzle-orm/pg-core";
|
|
26514
26539
|
var INDEXNOW_KINDS = ["auto", "manual", "retry"];
|
|
26515
26540
|
var INDEXNOW_STATUSES = ["ok", "failed"];
|
|
26516
26541
|
var indexnowSubmissions = pgTable77(
|
|
@@ -26523,7 +26548,7 @@ var indexnowSubmissions = pgTable77(
|
|
|
26523
26548
|
// FK → projects.id ON DELETE CASCADE (migration 0234)
|
|
26524
26549
|
/** The host as submitted, kept verbatim so a 422 stays explainable after a domain move. */
|
|
26525
26550
|
host: text78("host").notNull(),
|
|
26526
|
-
urls:
|
|
26551
|
+
urls: jsonb41("urls").$type().notNull().default([]),
|
|
26527
26552
|
urlCount: integer35("url_count").notNull().default(0),
|
|
26528
26553
|
status: varchar57("status", { length: 8 }).$type().notNull(),
|
|
26529
26554
|
/** NULL only when the request never got a response at all (DNS/timeout after 3 attempts). */
|
|
@@ -26536,7 +26561,7 @@ var indexnowSubmissions = pgTable77(
|
|
|
26536
26561
|
);
|
|
26537
26562
|
|
|
26538
26563
|
// src/schema/brand_kit_versions.ts
|
|
26539
|
-
import { pgTable as pgTable78, text as text79, integer as integer36, jsonb as
|
|
26564
|
+
import { pgTable as pgTable78, text as text79, integer as integer36, jsonb as jsonb42, timestamp as timestamp72, primaryKey as primaryKey5, index as index66 } from "drizzle-orm/pg-core";
|
|
26540
26565
|
var brandKitVersions = pgTable78(
|
|
26541
26566
|
"brand_kit_versions",
|
|
26542
26567
|
{
|
|
@@ -26547,7 +26572,7 @@ var brandKitVersions = pgTable78(
|
|
|
26547
26572
|
projectId: text79("project_id").notNull(),
|
|
26548
26573
|
// FK → projects.id ON DELETE CASCADE (0239)
|
|
26549
26574
|
version: integer36("version").notNull(),
|
|
26550
|
-
snapshot:
|
|
26575
|
+
snapshot: jsonb42("snapshot").$type().notNull(),
|
|
26551
26576
|
createdBy: text79("created_by"),
|
|
26552
26577
|
// FK → users(id), nullable: a system write has no author
|
|
26553
26578
|
createdAt: timestamp72("created_at").notNull().defaultNow()
|
|
@@ -26590,7 +26615,7 @@ var webhookDeliveries = pgTable79(
|
|
|
26590
26615
|
);
|
|
26591
26616
|
|
|
26592
26617
|
// src/schema/markdown_files.ts
|
|
26593
|
-
import { pgTable as pgTable80, text as text81, varchar as varchar59, timestamp as timestamp74, uniqueIndex as
|
|
26618
|
+
import { pgTable as pgTable80, text as text81, varchar as varchar59, timestamp as timestamp74, uniqueIndex as uniqueIndex33 } from "drizzle-orm/pg-core";
|
|
26594
26619
|
var MARKDOWN_FILE_STATUSES = ["draft", "published"];
|
|
26595
26620
|
var markdownFiles = pgTable80(
|
|
26596
26621
|
"markdown_files",
|
|
@@ -26609,7 +26634,7 @@ var markdownFiles = pgTable80(
|
|
|
26609
26634
|
createdAt: timestamp74("created_at").notNull().defaultNow(),
|
|
26610
26635
|
updatedAt: timestamp74("updated_at").notNull().defaultNow()
|
|
26611
26636
|
},
|
|
26612
|
-
(t) => [
|
|
26637
|
+
(t) => [uniqueIndex33("markdown_files_project_path_idx").on(t.projectId, t.path)]
|
|
26613
26638
|
);
|
|
26614
26639
|
var DEFAULT_AEO_CONFIG = {
|
|
26615
26640
|
llmsTxtEnabled: true,
|
|
@@ -26623,11 +26648,11 @@ import {
|
|
|
26623
26648
|
text as text84,
|
|
26624
26649
|
varchar as varchar62,
|
|
26625
26650
|
timestamp as timestamp76,
|
|
26626
|
-
jsonb as
|
|
26651
|
+
jsonb as jsonb44,
|
|
26627
26652
|
integer as integer39,
|
|
26628
26653
|
foreignKey as foreignKey4,
|
|
26629
26654
|
index as index70,
|
|
26630
|
-
uniqueIndex as
|
|
26655
|
+
uniqueIndex as uniqueIndex36
|
|
26631
26656
|
} from "drizzle-orm/pg-core";
|
|
26632
26657
|
import { relations as relations14 } from "drizzle-orm/relations";
|
|
26633
26658
|
import { sql as sql19 } from "drizzle-orm";
|
|
@@ -26637,11 +26662,11 @@ import {
|
|
|
26637
26662
|
foreignKey as foreignKey2,
|
|
26638
26663
|
index as index68,
|
|
26639
26664
|
integer as integer38,
|
|
26640
|
-
jsonb as
|
|
26665
|
+
jsonb as jsonb43,
|
|
26641
26666
|
pgTable as pgTable81,
|
|
26642
26667
|
text as text82,
|
|
26643
26668
|
timestamp as timestamp75,
|
|
26644
|
-
uniqueIndex as
|
|
26669
|
+
uniqueIndex as uniqueIndex34,
|
|
26645
26670
|
varchar as varchar60
|
|
26646
26671
|
} from "drizzle-orm/pg-core";
|
|
26647
26672
|
import { sql as sql17 } from "drizzle-orm";
|
|
@@ -26653,8 +26678,8 @@ var componentVariantGroups = pgTable81(
|
|
|
26653
26678
|
projectId: text82("project_id"),
|
|
26654
26679
|
name: varchar60("name", { length: 255 }).notNull(),
|
|
26655
26680
|
slug: varchar60("slug", { length: 255 }).notNull(),
|
|
26656
|
-
canonicalInputs:
|
|
26657
|
-
publishedCanonicalInputs:
|
|
26681
|
+
canonicalInputs: jsonb43("canonical_inputs").$type().notNull().default([]),
|
|
26682
|
+
publishedCanonicalInputs: jsonb43("published_canonical_inputs").$type(),
|
|
26658
26683
|
status: varchar60("status", { length: 20 }).notNull().default("draft"),
|
|
26659
26684
|
publishedAt: timestamp75("published_at"),
|
|
26660
26685
|
optimisticVersion: integer38("optimistic_version").notNull().default(0),
|
|
@@ -26670,7 +26695,7 @@ var componentVariantGroups = pgTable81(
|
|
|
26670
26695
|
}).onDelete("cascade"),
|
|
26671
26696
|
index68("component_variant_groups_workspace_idx").on(table.workspaceId),
|
|
26672
26697
|
index68("component_variant_groups_project_idx").on(table.projectId),
|
|
26673
|
-
|
|
26698
|
+
uniqueIndex34("component_variant_groups_scope_slug_unique").on(table.workspaceId, table.projectId, table.slug).where(sql17`${table.deletedAt} IS NULL`)
|
|
26674
26699
|
]
|
|
26675
26700
|
);
|
|
26676
26701
|
|
|
@@ -26680,7 +26705,7 @@ import {
|
|
|
26680
26705
|
index as index69,
|
|
26681
26706
|
pgTable as pgTable82,
|
|
26682
26707
|
text as text83,
|
|
26683
|
-
uniqueIndex as
|
|
26708
|
+
uniqueIndex as uniqueIndex35,
|
|
26684
26709
|
varchar as varchar61
|
|
26685
26710
|
} from "drizzle-orm/pg-core";
|
|
26686
26711
|
import { sql as sql18 } from "drizzle-orm";
|
|
@@ -26704,7 +26729,7 @@ var componentGroups = pgTable82(
|
|
|
26704
26729
|
}).onDelete("cascade"),
|
|
26705
26730
|
index69("component_groups_workspace_idx").on(table.workspaceId),
|
|
26706
26731
|
index69("component_groups_project_idx").on(table.projectId),
|
|
26707
|
-
|
|
26732
|
+
uniqueIndex35("component_groups_project_slug_unique").on(table.projectId, table.slug).where(sql18`${table.deletedAt} IS NULL`)
|
|
26708
26733
|
]
|
|
26709
26734
|
);
|
|
26710
26735
|
|
|
@@ -26753,15 +26778,15 @@ var components = pgTable83(
|
|
|
26753
26778
|
publishedVariantGroupId: text84("published_variant_group_id").references(() => componentVariantGroups.id, {
|
|
26754
26779
|
onDelete: "restrict"
|
|
26755
26780
|
}),
|
|
26756
|
-
variantInputMappings:
|
|
26781
|
+
variantInputMappings: jsonb44("variant_input_mappings").$type().notNull().default([]),
|
|
26757
26782
|
// The live canonical-input mapping snapshot. Draft mapping edits must never alter
|
|
26758
26783
|
// already-published Layout output before the Component is explicitly re-published.
|
|
26759
|
-
publishedVariantInputMappings:
|
|
26784
|
+
publishedVariantInputMappings: jsonb44("published_variant_input_mappings").$type(),
|
|
26760
26785
|
// Exact immutable family version adopted by this live variant. Legacy published rows
|
|
26761
26786
|
// have no manifest pin and use the one-time `publishedCanonicalInputs` snapshot instead.
|
|
26762
26787
|
publishedFamilyManifestId: text84("published_family_manifest_id"),
|
|
26763
26788
|
publishedFamilyManifestHash: varchar62("published_family_manifest_hash", { length: 64 }),
|
|
26764
|
-
publishedCanonicalInputs:
|
|
26789
|
+
publishedCanonicalInputs: jsonb44("published_canonical_inputs").$type(),
|
|
26765
26790
|
// Placement governance (migration 0190). Existing rows were backfilled to ["*"] so
|
|
26766
26791
|
// rollout preserves the old everywhere-visible behaviour; new project components start
|
|
26767
26792
|
// with [] and are deliberately approved from the section picker. Tokens are
|
|
@@ -26796,12 +26821,12 @@ var components = pgTable83(
|
|
|
26796
26821
|
groupId: text84("group_id").references(() => componentGroups.id, { onDelete: "restrict" }),
|
|
26797
26822
|
// Stored as unknown[] to keep @bettercms-ai/db decoupled from @bettercms-ai/types,
|
|
26798
26823
|
// matching pages.block_json. Validated as ContentBlock[] at the API layer.
|
|
26799
|
-
blockJson:
|
|
26800
|
-
props:
|
|
26824
|
+
blockJson: jsonb44("block_json").$type().notNull().default([]),
|
|
26825
|
+
props: jsonb44("props").$type().notNull().default([]),
|
|
26801
26826
|
// The editor controls this component declares ({ controls, cascade }, migration 0384).
|
|
26802
26827
|
// Authoring chrome, DRAFT-only: outside the publish snapshot, so it never makes a component
|
|
26803
26828
|
// "changed". Null keeps the dashboard's global controls. Validated at the API layer.
|
|
26804
|
-
design:
|
|
26829
|
+
design: jsonb44("design").$type(),
|
|
26805
26830
|
// Draft/live split (migration 0186_component_draft_live_split.sql). `blockJson`/`props`
|
|
26806
26831
|
// above are the DRAFT; these two are the LIVE snapshot that get_components_by_handle()
|
|
26807
26832
|
// serves. Nullable: a never-published component has no live copy. A DB trigger fills them
|
|
@@ -26809,8 +26834,8 @@ var components = pgTable83(
|
|
|
26809
26834
|
// trigger deliberately skips published -> published, or every autosave would go live).
|
|
26810
26835
|
// `props` splits alongside `blockJson` because applyOverrides() targets
|
|
26811
26836
|
// props[].target.blockId/path — a live tree paired with draft prop-defs mis-targets.
|
|
26812
|
-
publishedBlockJson:
|
|
26813
|
-
publishedProps:
|
|
26837
|
+
publishedBlockJson: jsonb44("published_block_json").$type(),
|
|
26838
|
+
publishedProps: jsonb44("published_props").$type(),
|
|
26814
26839
|
status: varchar62("status", { length: 20 }).$type().notNull().default("draft"),
|
|
26815
26840
|
publishedAt: timestamp76("published_at"),
|
|
26816
26841
|
// Out of the working set, still serving (FLO-1012). Deliberately NOT a third `status`
|
|
@@ -26864,7 +26889,7 @@ var components = pgTable83(
|
|
|
26864
26889
|
* src/lib/sections/registry.ts, which is handed every candidate and applies precedence
|
|
26865
26890
|
* itself. DB uniqueness here is data hygiene, not verdict correctness.
|
|
26866
26891
|
*/
|
|
26867
|
-
|
|
26892
|
+
uniqueIndex36("components_ws_proj_slug_managed_idx").on(table.workspaceId, table.projectId, table.branchId, table.slug, table.managedBy).where(sql19`${table.deletedAt} IS NULL`),
|
|
26868
26893
|
index70("components_managed_by_idx").on(table.managedBy).where(sql19`${table.deletedAt} IS NULL`),
|
|
26869
26894
|
// Partial: the section library only reads live sections. Mirrors migration 0156 —
|
|
26870
26895
|
// keep the two in step, or `drizzle-kit push` will want to drop the index it can't see.
|
|
@@ -26891,13 +26916,13 @@ var componentsRelations = relations14(components, ({ one }) => ({
|
|
|
26891
26916
|
}));
|
|
26892
26917
|
|
|
26893
26918
|
// src/schema/content_navigation.ts
|
|
26894
|
-
import { foreignKey as foreignKey5, index as index71, integer as integer40, jsonb as
|
|
26919
|
+
import { foreignKey as foreignKey5, index as index71, integer as integer40, jsonb as jsonb45, pgTable as pgTable84, text as text85, timestamp as timestamp77 } from "drizzle-orm/pg-core";
|
|
26895
26920
|
var contentNavigation = pgTable84(
|
|
26896
26921
|
"content_navigation",
|
|
26897
26922
|
{
|
|
26898
26923
|
projectId: text85("project_id").primaryKey(),
|
|
26899
26924
|
workspaceId: text85("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
|
|
26900
|
-
doc:
|
|
26925
|
+
doc: jsonb45("doc").$type().notNull().default({ schema: 1, folders: [], items: [] }),
|
|
26901
26926
|
version: integer40("version").notNull().default(1),
|
|
26902
26927
|
updatedBy: text85("updated_by"),
|
|
26903
26928
|
createdAt: timestamp77("created_at").notNull().defaultNow(),
|
|
@@ -26919,11 +26944,11 @@ import {
|
|
|
26919
26944
|
text as text86,
|
|
26920
26945
|
varchar as varchar63,
|
|
26921
26946
|
timestamp as timestamp78,
|
|
26922
|
-
jsonb as
|
|
26947
|
+
jsonb as jsonb46,
|
|
26923
26948
|
integer as integer41,
|
|
26924
26949
|
index as index72,
|
|
26925
26950
|
unique as unique4,
|
|
26926
|
-
uniqueIndex as
|
|
26951
|
+
uniqueIndex as uniqueIndex37
|
|
26927
26952
|
} from "drizzle-orm/pg-core";
|
|
26928
26953
|
import { relations as relations15 } from "drizzle-orm/relations";
|
|
26929
26954
|
import { sql as sql20 } from "drizzle-orm";
|
|
@@ -26936,7 +26961,7 @@ var componentVariants = pgTable85(
|
|
|
26936
26961
|
name: varchar63("name", { length: 255 }).notNull(),
|
|
26937
26962
|
// `<component-root>-<variant-name>`, e.g. `footer-compact`.
|
|
26938
26963
|
key: varchar63("key", { length: 356 }).notNull(),
|
|
26939
|
-
delta:
|
|
26964
|
+
delta: jsonb46("delta").$type().notNull().default({
|
|
26940
26965
|
fieldOverrides: [],
|
|
26941
26966
|
addedProps: [],
|
|
26942
26967
|
removedFieldKeys: [],
|
|
@@ -26944,7 +26969,7 @@ var componentVariants = pgTable85(
|
|
|
26944
26969
|
valueOverrides: {},
|
|
26945
26970
|
addedBlocks: []
|
|
26946
26971
|
}),
|
|
26947
|
-
publishedDelta:
|
|
26972
|
+
publishedDelta: jsonb46("published_delta").$type(),
|
|
26948
26973
|
status: varchar63("status", { length: 20 }).$type().notNull().default("draft"),
|
|
26949
26974
|
publishedAt: timestamp78("published_at"),
|
|
26950
26975
|
optimisticVersion: integer41("optimistic_version").notNull().default(0),
|
|
@@ -26960,7 +26985,7 @@ var componentVariants = pgTable85(
|
|
|
26960
26985
|
),
|
|
26961
26986
|
index72("component_variants_workspace_idx").on(table.workspaceId),
|
|
26962
26987
|
index72("component_variants_component_idx").on(table.componentId),
|
|
26963
|
-
|
|
26988
|
+
uniqueIndex37("component_variants_component_key_unique").on(table.componentId, table.key).where(sql20`${table.deletedAt} IS NULL`)
|
|
26964
26989
|
]
|
|
26965
26990
|
);
|
|
26966
26991
|
var componentVariantsRelations = relations15(componentVariants, ({ one }) => ({
|
|
@@ -26980,12 +27005,12 @@ import {
|
|
|
26980
27005
|
foreignKey as foreignKey6,
|
|
26981
27006
|
index as index73,
|
|
26982
27007
|
integer as integer42,
|
|
26983
|
-
jsonb as
|
|
27008
|
+
jsonb as jsonb47,
|
|
26984
27009
|
pgTable as pgTable86,
|
|
26985
27010
|
text as text87,
|
|
26986
27011
|
timestamp as timestamp79,
|
|
26987
27012
|
unique as unique5,
|
|
26988
|
-
uniqueIndex as
|
|
27013
|
+
uniqueIndex as uniqueIndex38,
|
|
26989
27014
|
uuid as uuid2,
|
|
26990
27015
|
varchar as varchar64
|
|
26991
27016
|
} from "drizzle-orm/pg-core";
|
|
@@ -27003,10 +27028,10 @@ var componentImplementationCandidates = pgTable86(
|
|
|
27003
27028
|
// Exact value-bearing family contract. Unlike `contract.canonicalInputs` (the
|
|
27004
27029
|
// renderer/schema projection), this snapshot deliberately retains defaults because it
|
|
27005
27030
|
// becomes the immutable public-input source pinned by each published variant.
|
|
27006
|
-
familyContract:
|
|
27031
|
+
familyContract: jsonb47("family_contract").$type(),
|
|
27007
27032
|
schemaHash: varchar64("schema_hash", { length: 64 }).notNull(),
|
|
27008
27033
|
brandContractHash: varchar64("brand_contract_hash", { length: 64 }).notNull(),
|
|
27009
|
-
contract:
|
|
27034
|
+
contract: jsonb47("contract").$type().notNull(),
|
|
27010
27035
|
createdBy: text87("created_by"),
|
|
27011
27036
|
createdAt: timestamp79("created_at").notNull().defaultNow()
|
|
27012
27037
|
},
|
|
@@ -27019,7 +27044,7 @@ var componentImplementationCandidates = pgTable86(
|
|
|
27019
27044
|
// v1 candidates (created before 0263) have no exact family-contract bytes. They must not
|
|
27020
27045
|
// occupy the v2 tuple: validation needs to append an exact candidate beside the legacy
|
|
27021
27046
|
// row instead of either mutating it or selecting it by matching hashes alone.
|
|
27022
|
-
|
|
27047
|
+
uniqueIndex38("component_implementation_candidate_exact_tuple_unique").on(
|
|
27023
27048
|
table.projectId,
|
|
27024
27049
|
table.componentId,
|
|
27025
27050
|
table.schemaHash,
|
|
@@ -27038,13 +27063,13 @@ var componentFamilyManifests = pgTable86(
|
|
|
27038
27063
|
projectId: text87("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
27039
27064
|
familyKey: text87("family_key").notNull(),
|
|
27040
27065
|
familyContractHash: varchar64("family_contract_hash", { length: 64 }).notNull(),
|
|
27041
|
-
familyContract:
|
|
27066
|
+
familyContract: jsonb47("family_contract").$type(),
|
|
27042
27067
|
commitSha: varchar64("commit_sha", { length: 64 }).notNull(),
|
|
27043
27068
|
adapterHash: varchar64("adapter_hash", { length: 64 }).notNull(),
|
|
27044
27069
|
manifestHash: varchar64("manifest_hash", { length: 64 }).notNull(),
|
|
27045
27070
|
previewOrigin: text87("preview_origin").notNull(),
|
|
27046
|
-
nativeViewports:
|
|
27047
|
-
adapter:
|
|
27071
|
+
nativeViewports: jsonb47("native_viewports").$type().notNull(),
|
|
27072
|
+
adapter: jsonb47("adapter").$type().notNull(),
|
|
27048
27073
|
createdBy: text87("created_by"),
|
|
27049
27074
|
createdAt: timestamp79("created_at").notNull().defaultNow()
|
|
27050
27075
|
},
|
|
@@ -27057,7 +27082,7 @@ var componentFamilyManifests = pgTable86(
|
|
|
27057
27082
|
unique5("component_family_manifests_scope_unique").on(table.id, table.projectId, table.familyKey),
|
|
27058
27083
|
unique5("component_family_manifests_id_project_unique").on(table.id, table.projectId),
|
|
27059
27084
|
unique5("component_family_manifests_evidence_unique").on(table.id, table.projectId, table.manifestHash),
|
|
27060
|
-
|
|
27085
|
+
uniqueIndex38("component_family_manifest_tuple_unique").on(table.projectId, table.familyKey, table.manifestHash),
|
|
27061
27086
|
index73("component_family_manifests_family_idx").on(table.projectId, table.familyKey, table.createdAt)
|
|
27062
27087
|
]
|
|
27063
27088
|
);
|
|
@@ -27081,9 +27106,9 @@ var componentImplementationRequests = pgTable86(
|
|
|
27081
27106
|
adapterHash: varchar64("adapter_hash", { length: 64 }),
|
|
27082
27107
|
familyManifestHash: varchar64("family_manifest_hash", { length: 64 }),
|
|
27083
27108
|
previewOrigin: text87("preview_origin"),
|
|
27084
|
-
nativeViewports:
|
|
27085
|
-
adapter:
|
|
27086
|
-
providerProvenance:
|
|
27109
|
+
nativeViewports: jsonb47("native_viewports").$type(),
|
|
27110
|
+
adapter: jsonb47("adapter").$type(),
|
|
27111
|
+
providerProvenance: jsonb47("provider_provenance").$type(),
|
|
27087
27112
|
claimedByApiKeyId: text87("claimed_by_api_key_id"),
|
|
27088
27113
|
claimCredentialHash: varchar64("claim_credential_hash", { length: 64 }),
|
|
27089
27114
|
claimCredentialExpiresAt: timestamp79("claim_credential_expires_at", { withTimezone: true }),
|
|
@@ -27112,7 +27137,7 @@ var componentImplementationRequests = pgTable86(
|
|
|
27112
27137
|
name: "component_implementation_requests_candidate_fkey"
|
|
27113
27138
|
}).onDelete("cascade"),
|
|
27114
27139
|
unique5("component_implementation_requests_scope_unique").on(table.id, table.projectId, table.componentId),
|
|
27115
|
-
|
|
27140
|
+
uniqueIndex38("component_implementation_requests_active_unique").on(table.projectId, table.componentId).where(sql21`${table.status} IN ('pending', 'claimed')`),
|
|
27116
27141
|
index73("component_implementation_requests_claimable_idx").on(table.projectId, table.status, table.expiresAt, table.createdAt)
|
|
27117
27142
|
]
|
|
27118
27143
|
);
|
|
@@ -27127,17 +27152,17 @@ var componentImplementationEvidence = pgTable86(
|
|
|
27127
27152
|
familyManifestId: text87("family_manifest_id").notNull(),
|
|
27128
27153
|
familyManifestHash: varchar64("family_manifest_hash", { length: 64 }).notNull(),
|
|
27129
27154
|
variantBindingHash: varchar64("variant_binding_hash", { length: 64 }).notNull(),
|
|
27130
|
-
variantBinding:
|
|
27155
|
+
variantBinding: jsonb47("variant_binding").$type().notNull(),
|
|
27131
27156
|
requestId: text87("request_id"),
|
|
27132
27157
|
schemaHash: varchar64("schema_hash", { length: 64 }).notNull(),
|
|
27133
27158
|
brandContractHash: varchar64("brand_contract_hash", { length: 64 }).notNull(),
|
|
27134
27159
|
commitSha: varchar64("commit_sha", { length: 64 }).notNull(),
|
|
27135
27160
|
adapterHash: varchar64("adapter_hash", { length: 64 }).notNull(),
|
|
27136
27161
|
previewOrigin: text87("preview_origin").notNull(),
|
|
27137
|
-
nativeViewports:
|
|
27138
|
-
adapter:
|
|
27162
|
+
nativeViewports: jsonb47("native_viewports").$type().notNull(),
|
|
27163
|
+
adapter: jsonb47("adapter").$type().notNull(),
|
|
27139
27164
|
status: varchar64("status", { length: 20 }).$type().notNull(),
|
|
27140
|
-
checks:
|
|
27165
|
+
checks: jsonb47("checks").$type().notNull(),
|
|
27141
27166
|
evidenceDigest: varchar64("evidence_digest", { length: 128 }).notNull(),
|
|
27142
27167
|
evidenceTupleHash: varchar64("evidence_tuple_hash", { length: 64 }).notNull(),
|
|
27143
27168
|
createdBy: text87("created_by"),
|
|
@@ -27164,8 +27189,8 @@ var componentImplementationEvidence = pgTable86(
|
|
|
27164
27189
|
foreignColumns: [componentImplementationRequests.id, componentImplementationRequests.projectId, componentImplementationRequests.componentId],
|
|
27165
27190
|
name: "component_implementation_evidence_request_fkey"
|
|
27166
27191
|
}).onDelete("restrict"),
|
|
27167
|
-
|
|
27168
|
-
|
|
27192
|
+
uniqueIndex38("component_implementation_evidence_digest_unique").on(table.projectId, table.componentId, table.evidenceDigest),
|
|
27193
|
+
uniqueIndex38("component_implementation_evidence_request_unique").on(table.requestId).where(sql21`${table.requestId} IS NOT NULL`),
|
|
27169
27194
|
unique5("component_implementation_evidence_scope_unique").on(table.id, table.projectId, table.componentId),
|
|
27170
27195
|
index73("component_implementation_evidence_candidate_idx").on(table.candidateId, table.createdAt)
|
|
27171
27196
|
]
|
|
@@ -27198,7 +27223,7 @@ var componentImplementationApprovals = pgTable86(
|
|
|
27198
27223
|
foreignColumns: [componentImplementationEvidence.id, componentImplementationEvidence.projectId, componentImplementationEvidence.componentId],
|
|
27199
27224
|
name: "component_implementation_approvals_evidence_fkey"
|
|
27200
27225
|
}).onDelete("cascade"),
|
|
27201
|
-
|
|
27226
|
+
uniqueIndex38("component_implementation_approval_evidence_unique").on(table.evidenceId),
|
|
27202
27227
|
unique5("component_implementation_approval_scope_unique").on(table.id, table.projectId, table.componentId),
|
|
27203
27228
|
index73("component_implementation_approvals_component_idx").on(table.projectId, table.componentId)
|
|
27204
27229
|
]
|
|
@@ -27214,7 +27239,7 @@ var componentImplementationAdapters = pgTable86(
|
|
|
27214
27239
|
workspaceId: text87("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
|
|
27215
27240
|
projectId: text87("project_id").notNull(),
|
|
27216
27241
|
componentId: text87("component_id").notNull().references(() => components.id, { onDelete: "cascade" }),
|
|
27217
|
-
adapter:
|
|
27242
|
+
adapter: jsonb47("adapter").$type().notNull(),
|
|
27218
27243
|
adapterHash: varchar64("adapter_hash", { length: 64 }).notNull(),
|
|
27219
27244
|
source: varchar64("source", { length: 24 }).$type().notNull(),
|
|
27220
27245
|
declaredBy: text87("declared_by"),
|
|
@@ -27259,7 +27284,7 @@ var componentImplementationStates = pgTable86(
|
|
|
27259
27284
|
foreignColumns: [projects.id, projects.workspaceId],
|
|
27260
27285
|
name: "component_implementation_states_project_workspace_fkey"
|
|
27261
27286
|
}).onDelete("cascade"),
|
|
27262
|
-
|
|
27287
|
+
uniqueIndex38("component_implementation_states_component_unique").on(table.projectId, table.componentId),
|
|
27263
27288
|
index73("component_implementation_states_workspace_idx").on(table.workspaceId)
|
|
27264
27289
|
]
|
|
27265
27290
|
);
|
|
@@ -27327,13 +27352,13 @@ import {
|
|
|
27327
27352
|
foreignKey as foreignKey7,
|
|
27328
27353
|
index as index74,
|
|
27329
27354
|
integer as integer43,
|
|
27330
|
-
jsonb as
|
|
27355
|
+
jsonb as jsonb48,
|
|
27331
27356
|
pgTable as pgTable87,
|
|
27332
27357
|
primaryKey as primaryKey6,
|
|
27333
27358
|
text as text88,
|
|
27334
27359
|
timestamp as timestamp80,
|
|
27335
27360
|
unique as unique6,
|
|
27336
|
-
uniqueIndex as
|
|
27361
|
+
uniqueIndex as uniqueIndex39,
|
|
27337
27362
|
uuid as uuid3,
|
|
27338
27363
|
varchar as varchar65
|
|
27339
27364
|
} from "drizzle-orm/pg-core";
|
|
@@ -27377,7 +27402,7 @@ var orchestrationRuns = pgTable87(
|
|
|
27377
27402
|
targetKind: varchar65("target_kind", { length: 32 }).$type().notNull().default("component-variant"),
|
|
27378
27403
|
targetId: text88("target_id").notNull().references(() => components.id, { onDelete: "no action" }),
|
|
27379
27404
|
targetVariantId: text88("target_variant_id"),
|
|
27380
|
-
targetMetadata:
|
|
27405
|
+
targetMetadata: jsonb48("target_metadata").$type().notNull(),
|
|
27381
27406
|
status: varchar65("status", { length: 20 }).$type().notNull().default("open"),
|
|
27382
27407
|
activeStage: varchar65("active_stage", { length: 64 }).notNull().default("awaiting-executor"),
|
|
27383
27408
|
version: integer43("version").notNull().default(1),
|
|
@@ -27410,7 +27435,7 @@ var orchestrationRuns = pgTable87(
|
|
|
27410
27435
|
table.projectId,
|
|
27411
27436
|
table.startIdempotencyKey
|
|
27412
27437
|
),
|
|
27413
|
-
|
|
27438
|
+
uniqueIndex39("orchestration_runs_nonterminal_project_unique").on(table.projectId).where(sql22`${table.status} IN ('open', 'paused', 'cancelling')`),
|
|
27414
27439
|
index74("orchestration_runs_project_target_idx").on(
|
|
27415
27440
|
table.projectId,
|
|
27416
27441
|
table.targetKind,
|
|
@@ -27543,7 +27568,7 @@ var orchestrationRunEvents = pgTable87(
|
|
|
27543
27568
|
actorId: text88("actor_id").notNull(),
|
|
27544
27569
|
causationId: text88("causation_id"),
|
|
27545
27570
|
correlationId: text88("correlation_id"),
|
|
27546
|
-
payload:
|
|
27571
|
+
payload: jsonb48("payload").$type().notNull().default({}),
|
|
27547
27572
|
payloadDigest: varchar65("payload_digest", { length: 71 }).generatedAlwaysAs(
|
|
27548
27573
|
sql22`'sha256:' || encode(digest(payload::text, 'sha256'), 'hex')`
|
|
27549
27574
|
),
|
|
@@ -27585,7 +27610,7 @@ var orchestrationRunCommandResults = pgTable87(
|
|
|
27585
27610
|
resultingVersion: integer43("resulting_version").notNull(),
|
|
27586
27611
|
actorId: text88("actor_id").notNull(),
|
|
27587
27612
|
eventId: uuid3("event_id").notNull().references(() => orchestrationRunEvents.id, { onDelete: "cascade" }),
|
|
27588
|
-
resultPayload:
|
|
27613
|
+
resultPayload: jsonb48("result_payload").$type().notNull(),
|
|
27589
27614
|
createdAt: timestamp80("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
27590
27615
|
},
|
|
27591
27616
|
(table) => [
|
|
@@ -27631,12 +27656,12 @@ import {
|
|
|
27631
27656
|
foreignKey as foreignKey8,
|
|
27632
27657
|
index as index75,
|
|
27633
27658
|
integer as integer44,
|
|
27634
|
-
jsonb as
|
|
27659
|
+
jsonb as jsonb49,
|
|
27635
27660
|
pgTable as pgTable88,
|
|
27636
27661
|
text as text89,
|
|
27637
27662
|
timestamp as timestamp81,
|
|
27638
27663
|
unique as unique7,
|
|
27639
|
-
uniqueIndex as
|
|
27664
|
+
uniqueIndex as uniqueIndex40,
|
|
27640
27665
|
uuid as uuid4,
|
|
27641
27666
|
varchar as varchar66
|
|
27642
27667
|
} from "drizzle-orm/pg-core";
|
|
@@ -27689,7 +27714,7 @@ var orchestrationExecutorInstallations = pgTable88(
|
|
|
27689
27714
|
grantId: text89("grant_id").references(() => deviceAuthorizations.id, { onDelete: "cascade" }),
|
|
27690
27715
|
protocolVersion: varchar66("protocol_version", { length: 16 }).notNull(),
|
|
27691
27716
|
capabilityDigest: text89("capability_digest").notNull(),
|
|
27692
|
-
repositoryClaim:
|
|
27717
|
+
repositoryClaim: jsonb49("repository_claim").$type().notNull().default({}),
|
|
27693
27718
|
status: varchar66("status", { length: 20 }).$type().notNull().default("active"),
|
|
27694
27719
|
createdAt: timestamp81("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
27695
27720
|
updatedAt: timestamp81("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
@@ -27709,8 +27734,8 @@ var orchestrationExecutorInstallations = pgTable88(
|
|
|
27709
27734
|
table.projectId,
|
|
27710
27735
|
table.status
|
|
27711
27736
|
),
|
|
27712
|
-
|
|
27713
|
-
|
|
27737
|
+
uniqueIndex40("orchestration_executor_installations_grant_unique").on(table.projectId, table.grantId).where(sql23`${table.grantId} IS NOT NULL AND ${table.status} = 'active'`),
|
|
27738
|
+
uniqueIndex40("orchestration_executor_installations_dashboard_unique").on(table.projectId).where(sql23`${table.kind} = 'dashboard-agent' AND ${table.status} = 'active'`),
|
|
27714
27739
|
check6(
|
|
27715
27740
|
"orchestration_executor_installations_kind_check",
|
|
27716
27741
|
sql23`${table.kind} IN ('dashboard-agent', 'native-bridge')`
|
|
@@ -27913,8 +27938,8 @@ var orchestrationPlanSnapshots = pgTable88(
|
|
|
27913
27938
|
workspaceId: text89("workspace_id").notNull().references(() => workspaces.id, { onDelete: "cascade" }),
|
|
27914
27939
|
projectId: text89("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
27915
27940
|
baseHeadOid: varchar66("base_head_oid", { length: 64 }).notNull(),
|
|
27916
|
-
budget:
|
|
27917
|
-
files:
|
|
27941
|
+
budget: jsonb49("budget").notNull(),
|
|
27942
|
+
files: jsonb49("files").notNull(),
|
|
27918
27943
|
fileCount: integer44("file_count").notNull(),
|
|
27919
27944
|
byteCount: bigint5("byte_count", { mode: "number" }).notNull(),
|
|
27920
27945
|
createdAt: timestamp81("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
@@ -28027,9 +28052,9 @@ var orchestrationExecutionApprovals = pgTable88(
|
|
|
28027
28052
|
* other field on a row a human signed stays as unwritable as it was before. */
|
|
28028
28053
|
consumedAt: timestamp81("consumed_at", { withTimezone: true }),
|
|
28029
28054
|
consumedByAttemptId: uuid4("consumed_by_attempt_id"),
|
|
28030
|
-
pathPolicy:
|
|
28031
|
-
operationClasses:
|
|
28032
|
-
mutationBudget:
|
|
28055
|
+
pathPolicy: jsonb49("path_policy").$type().notNull().default({}),
|
|
28056
|
+
operationClasses: jsonb49("operation_classes").$type().notNull().default([]),
|
|
28057
|
+
mutationBudget: jsonb49("mutation_budget").$type().notNull().default({}),
|
|
28033
28058
|
planDigest: text89("plan_digest").notNull(),
|
|
28034
28059
|
capabilityDigest: text89("capability_digest").notNull(),
|
|
28035
28060
|
validationDigest: text89("validation_digest").notNull(),
|
|
@@ -28171,7 +28196,7 @@ var orchestrationExecutorLeases = pgTable88(
|
|
|
28171
28196
|
),
|
|
28172
28197
|
unique7("orchestration_executor_leases_epoch_unique").on(table.attemptId, table.leaseEpoch),
|
|
28173
28198
|
// Plan invariant 6, enforced in the database: a run has at most one active executor lease.
|
|
28174
|
-
|
|
28199
|
+
uniqueIndex40("orchestration_executor_leases_one_active_per_run").on(table.runId).where(sql23`${table.state} = 'active'`),
|
|
28175
28200
|
index75("orchestration_executor_leases_deadline_idx").on(table.heartbeatDeadline).where(sql23`${table.state} = 'active'`),
|
|
28176
28201
|
check6("orchestration_executor_leases_epoch_check", sql23`${table.leaseEpoch} >= 1`),
|
|
28177
28202
|
check6(
|
|
@@ -28211,7 +28236,7 @@ var orchestrationExecutorCommands = pgTable88(
|
|
|
28211
28236
|
kind: varchar66("kind", { length: 32 }).$type().notNull(),
|
|
28212
28237
|
idempotencyKey: text89("idempotency_key").notNull(),
|
|
28213
28238
|
expectedRunVersion: integer44("expected_run_version").notNull(),
|
|
28214
|
-
payload:
|
|
28239
|
+
payload: jsonb49("payload").$type().notNull().default({}),
|
|
28215
28240
|
payloadDigest: varchar66("payload_digest", { length: 71 }).generatedAlwaysAs(
|
|
28216
28241
|
sql23`'sha256:' || encode(digest(payload::text, 'sha256'), 'hex')`
|
|
28217
28242
|
),
|
|
@@ -28423,7 +28448,7 @@ var orchestrationPullRequestReceipts = pgTable88(
|
|
|
28423
28448
|
|
|
28424
28449
|
// src/schema/conversion_proposals.ts
|
|
28425
28450
|
import { sql as sql24 } from "drizzle-orm";
|
|
28426
|
-
import { check as check7, foreignKey as foreignKey9, index as index76, integer as integer45, jsonb as
|
|
28451
|
+
import { check as check7, foreignKey as foreignKey9, index as index76, integer as integer45, jsonb as jsonb50, pgTable as pgTable89, text as text90, timestamp as timestamp82, unique as unique8, uuid as uuid5, varchar as varchar67 } from "drizzle-orm/pg-core";
|
|
28427
28452
|
var CONVERSION_PROPOSAL_STATUSES = ["draft", "approved", "superseded"];
|
|
28428
28453
|
var conversionProposals = pgTable89(
|
|
28429
28454
|
"conversion_proposals",
|
|
@@ -28438,9 +28463,9 @@ var conversionProposals = pgTable89(
|
|
|
28438
28463
|
baseHeadOid: varchar67("base_head_oid", { length: 64 }).notNull(),
|
|
28439
28464
|
baseBranch: text90("base_branch").notNull(),
|
|
28440
28465
|
/** Brief paths whose `original` was not found in any source file. */
|
|
28441
|
-
unlocated:
|
|
28466
|
+
unlocated: jsonb50("unlocated").notNull().default(sql24`'[]'::jsonb`),
|
|
28442
28467
|
/** Files that matched a brief original but fell outside the acquisition caps. */
|
|
28443
|
-
omittedByCap:
|
|
28468
|
+
omittedByCap: jsonb50("omitted_by_cap").notNull().default(sql24`'[]'::jsonb`),
|
|
28444
28469
|
/**
|
|
28445
28470
|
* The codemod's receipt (migration 0296) — every path it bound, and every one it could not.
|
|
28446
28471
|
*
|
|
@@ -28448,7 +28473,7 @@ var conversionProposals = pgTable89(
|
|
|
28448
28473
|
* pending list for those, which is exactly the silent "nothing left to do" this lane refuses.
|
|
28449
28474
|
* Informative: `proposeConversion` re-derives every claim it acts on from the proposed files.
|
|
28450
28475
|
*/
|
|
28451
|
-
receipt:
|
|
28476
|
+
receipt: jsonb50("receipt"),
|
|
28452
28477
|
status: text90("status").notNull().default("draft"),
|
|
28453
28478
|
version: integer45("version").notNull().default(1),
|
|
28454
28479
|
idempotencyKey: text90("idempotency_key").notNull(),
|
|
@@ -28484,7 +28509,7 @@ var conversionProposals = pgTable89(
|
|
|
28484
28509
|
|
|
28485
28510
|
// src/schema/conversion_briefs_issued.ts
|
|
28486
28511
|
import { sql as sql25 } from "drizzle-orm";
|
|
28487
|
-
import { check as check8, foreignKey as foreignKey10, index as index77, jsonb as
|
|
28512
|
+
import { check as check8, foreignKey as foreignKey10, index as index77, jsonb as jsonb51, pgTable as pgTable90, text as text91, timestamp as timestamp83, unique as unique9, uuid as uuid6 } from "drizzle-orm/pg-core";
|
|
28488
28513
|
var conversionBriefsIssued = pgTable90(
|
|
28489
28514
|
"conversion_briefs_issued",
|
|
28490
28515
|
{
|
|
@@ -28494,13 +28519,13 @@ var conversionBriefsIssued = pgTable90(
|
|
|
28494
28519
|
/** sha256 of the canonical brief — `briefDigest`, computed identically by the codemod. */
|
|
28495
28520
|
briefDigest: text91("brief_digest").notNull(),
|
|
28496
28521
|
/** `[{ route, scope, path, kind, locator? }]` — every bindable path the brief listed. */
|
|
28497
|
-
paths:
|
|
28522
|
+
paths: jsonb51("paths").notNull().default(sql25`'[]'::jsonb`),
|
|
28498
28523
|
/**
|
|
28499
28524
|
* The codemod's account of the run against THIS digest (`submit_conversion_receipt`): which
|
|
28500
28525
|
* paths it rewrote, which it could not, and why. Null until one is submitted — a hand
|
|
28501
28526
|
* conversion never submits one and still counts toward coverage.
|
|
28502
28527
|
*/
|
|
28503
|
-
receipt:
|
|
28528
|
+
receipt: jsonb51("receipt"),
|
|
28504
28529
|
/** The LAST time this pin was issued. What a retention sweep keys on. */
|
|
28505
28530
|
issuedAt: timestamp83("issued_at", { withTimezone: true }).notNull().defaultNow()
|
|
28506
28531
|
},
|
|
@@ -28525,12 +28550,12 @@ import {
|
|
|
28525
28550
|
foreignKey as foreignKey11,
|
|
28526
28551
|
index as index78,
|
|
28527
28552
|
integer as integer46,
|
|
28528
|
-
jsonb as
|
|
28553
|
+
jsonb as jsonb52,
|
|
28529
28554
|
pgTable as pgTable91,
|
|
28530
28555
|
text as text92,
|
|
28531
28556
|
timestamp as timestamp84,
|
|
28532
28557
|
unique as unique10,
|
|
28533
|
-
uniqueIndex as
|
|
28558
|
+
uniqueIndex as uniqueIndex41,
|
|
28534
28559
|
uuid as uuid7,
|
|
28535
28560
|
varchar as varchar68
|
|
28536
28561
|
} from "drizzle-orm/pg-core";
|
|
@@ -28613,7 +28638,7 @@ var orchestrationValidationEnvelopes = pgTable91(
|
|
|
28613
28638
|
}).onDelete("set null"),
|
|
28614
28639
|
// One live envelope per (attempt, head): two validators can never both be authoritative for
|
|
28615
28640
|
// the same commit. The index arbitrates, so no read-then-write can lose the race.
|
|
28616
|
-
|
|
28641
|
+
uniqueIndex41("orchestration_validation_envelopes_one_live_per_head").on(table.attemptId, table.headSha).where(sql26`status IN ('queued', 'dispatched', 'action_required')`),
|
|
28617
28642
|
index78("orchestration_validation_envelopes_attempt_idx").on(
|
|
28618
28643
|
table.attemptId,
|
|
28619
28644
|
table.createdAt.desc()
|
|
@@ -28653,7 +28678,7 @@ var orchestrationValidationEvidence = pgTable91(
|
|
|
28653
28678
|
brandContractHash: varchar68("brand_contract_hash", { length: 64 }).notNull(),
|
|
28654
28679
|
status: varchar68("status", { length: 10 }).notNull(),
|
|
28655
28680
|
/** brandKit / runtime / visual. The shape is enforced by CHECK in 0273, not by the writer. */
|
|
28656
|
-
checks:
|
|
28681
|
+
checks: jsonb52("checks").notNull(),
|
|
28657
28682
|
createdBy: text92("created_by"),
|
|
28658
28683
|
createdAt: timestamp84("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
28659
28684
|
},
|
|
@@ -28692,7 +28717,7 @@ var orchestrationValidationEvidence = pgTable91(
|
|
|
28692
28717
|
|
|
28693
28718
|
// src/schema/orchestration_executor_grants.ts
|
|
28694
28719
|
import { sql as sql27 } from "drizzle-orm";
|
|
28695
|
-
import { check as check10, foreignKey as foreignKey12, index as index79, integer as integer47, pgTable as pgTable92, text as text93, timestamp as timestamp85, unique as unique11, uniqueIndex as
|
|
28720
|
+
import { check as check10, foreignKey as foreignKey12, index as index79, integer as integer47, pgTable as pgTable92, text as text93, timestamp as timestamp85, unique as unique11, uniqueIndex as uniqueIndex42, uuid as uuid8, varchar as varchar69 } from "drizzle-orm/pg-core";
|
|
28696
28721
|
var EXECUTOR_GRANT_STATUSES = ["active", "revoked", "expired"];
|
|
28697
28722
|
var orchestrationExecutorGrants = pgTable92(
|
|
28698
28723
|
"orchestration_executor_grants",
|
|
@@ -28731,7 +28756,7 @@ var orchestrationExecutorGrants = pgTable92(
|
|
|
28731
28756
|
}).onDelete("cascade"),
|
|
28732
28757
|
// One live credential per installation. Two would mean two processes can each present a valid
|
|
28733
28758
|
// one, and the exclusion argument collapses before the lease layer is reached.
|
|
28734
|
-
|
|
28759
|
+
uniqueIndex42("orchestration_executor_grants_one_active_per_installation").on(table.installationId).where(sql27`status = 'active'`),
|
|
28735
28760
|
index79("orchestration_executor_grants_credential_idx").on(table.workspaceId, table.credentialHash).where(sql27`status = 'active'`),
|
|
28736
28761
|
check10(
|
|
28737
28762
|
"orchestration_executor_grants_status_check",
|
|
@@ -28745,7 +28770,7 @@ var orchestrationExecutorGrants = pgTable92(
|
|
|
28745
28770
|
);
|
|
28746
28771
|
|
|
28747
28772
|
// src/schema/component_presets.ts
|
|
28748
|
-
import { pgTable as pgTable93, text as text94, varchar as varchar70, timestamp as timestamp86, jsonb as
|
|
28773
|
+
import { pgTable as pgTable93, text as text94, varchar as varchar70, timestamp as timestamp86, jsonb as jsonb53, integer as integer48, index as index80, uniqueIndex as uniqueIndex43 } from "drizzle-orm/pg-core";
|
|
28749
28774
|
import { relations as relations16 } from "drizzle-orm";
|
|
28750
28775
|
var componentPresets = pgTable93(
|
|
28751
28776
|
"component_presets",
|
|
@@ -28757,7 +28782,7 @@ var componentPresets = pgTable93(
|
|
|
28757
28782
|
/** ^[a-z0-9-]+$, unique per component — stable across renames. */
|
|
28758
28783
|
slug: varchar70("slug", { length: 255 }).notNull(),
|
|
28759
28784
|
/** Prop key → value. Validated against the component's `props` on every write. */
|
|
28760
|
-
values:
|
|
28785
|
+
values: jsonb53("values").$type().notNull().default({}),
|
|
28761
28786
|
position: integer48("position").notNull().default(0),
|
|
28762
28787
|
createdAt: timestamp86("created_at").notNull().defaultNow(),
|
|
28763
28788
|
updatedAt: timestamp86("updated_at").notNull().defaultNow(),
|
|
@@ -28766,7 +28791,7 @@ var componentPresets = pgTable93(
|
|
|
28766
28791
|
},
|
|
28767
28792
|
(t) => [
|
|
28768
28793
|
index80("component_presets_component_position_idx").on(t.componentId, t.position, t.createdAt, t.id),
|
|
28769
|
-
|
|
28794
|
+
uniqueIndex43("component_presets_component_slug_key").on(t.componentId, t.slug)
|
|
28770
28795
|
]
|
|
28771
28796
|
);
|
|
28772
28797
|
var componentPresetsRelations = relations16(componentPresets, ({ one }) => ({
|
|
@@ -28781,12 +28806,12 @@ import {
|
|
|
28781
28806
|
foreignKey as foreignKey13,
|
|
28782
28807
|
index as index81,
|
|
28783
28808
|
integer as integer49,
|
|
28784
|
-
jsonb as
|
|
28809
|
+
jsonb as jsonb54,
|
|
28785
28810
|
pgTable as pgTable94,
|
|
28786
28811
|
text as text95,
|
|
28787
28812
|
timestamp as timestamp87,
|
|
28788
28813
|
unique as unique12,
|
|
28789
|
-
uniqueIndex as
|
|
28814
|
+
uniqueIndex as uniqueIndex44,
|
|
28790
28815
|
varchar as varchar71
|
|
28791
28816
|
} from "drizzle-orm/pg-core";
|
|
28792
28817
|
import { sql as sql28 } from "drizzle-orm";
|
|
@@ -28816,7 +28841,7 @@ var sectionDefinitions = pgTable94(
|
|
|
28816
28841
|
name: "section_definitions_project_workspace_fkey"
|
|
28817
28842
|
}).onDelete("cascade").onUpdate("cascade"),
|
|
28818
28843
|
unique12("section_definitions_id_project_unique").on(table.id, table.projectId),
|
|
28819
|
-
|
|
28844
|
+
uniqueIndex44("section_definitions_project_api_id_unique").on(table.projectId, table.apiId),
|
|
28820
28845
|
index81("section_definitions_workspace_idx").on(table.workspaceId),
|
|
28821
28846
|
index81("section_definitions_project_idx").on(table.projectId)
|
|
28822
28847
|
]
|
|
@@ -28830,7 +28855,7 @@ var sectionDefinitionVersions = pgTable94(
|
|
|
28830
28855
|
sectionDefinitionId: text95("section_definition_id").notNull(),
|
|
28831
28856
|
version: integer49("version").notNull(),
|
|
28832
28857
|
label: varchar71("label", { length: 255 }).notNull(),
|
|
28833
|
-
fields:
|
|
28858
|
+
fields: jsonb54("fields").$type().notNull().default([]),
|
|
28834
28859
|
schemaHash: varchar71("schema_hash", { length: 64 }).notNull(),
|
|
28835
28860
|
createdBy: text95("created_by"),
|
|
28836
28861
|
createdAt: timestamp87("created_at").notNull().defaultNow()
|
|
@@ -28875,7 +28900,7 @@ var sectionZones = pgTable94(
|
|
|
28875
28900
|
name: "section_zones_project_workspace_fkey"
|
|
28876
28901
|
}).onDelete("cascade").onUpdate("cascade"),
|
|
28877
28902
|
unique12("section_zones_id_project_unique").on(table.id, table.projectId),
|
|
28878
|
-
|
|
28903
|
+
uniqueIndex44("section_zones_schema_owner_unique").on(table.projectId, table.schemaKind, table.schemaId),
|
|
28879
28904
|
index81("section_zones_workspace_idx").on(table.workspaceId)
|
|
28880
28905
|
]
|
|
28881
28906
|
);
|
|
@@ -28926,7 +28951,7 @@ var sectionZoneAttachments = pgTable94(
|
|
|
28926
28951
|
],
|
|
28927
28952
|
name: "section_zone_attachments_published_version_fkey"
|
|
28928
28953
|
}).onDelete("restrict"),
|
|
28929
|
-
|
|
28954
|
+
uniqueIndex44("section_zone_attachments_zone_definition_unique").on(table.zoneId, table.sectionDefinitionId),
|
|
28930
28955
|
index81("section_zone_attachments_zone_position_idx").on(table.zoneId, table.position, table.id)
|
|
28931
28956
|
]
|
|
28932
28957
|
);
|
|
@@ -28941,7 +28966,7 @@ var sectionManifests = pgTable94(
|
|
|
28941
28966
|
apiId: varchar71("api_id", { length: 100 }).notNull(),
|
|
28942
28967
|
schemaHash: varchar71("schema_hash", { length: 64 }).notNull(),
|
|
28943
28968
|
commitSha: varchar71("commit_sha", { length: 64 }).notNull(),
|
|
28944
|
-
manifest:
|
|
28969
|
+
manifest: jsonb54("manifest").$type().notNull(),
|
|
28945
28970
|
createdBy: text95("created_by"),
|
|
28946
28971
|
createdAt: timestamp87("created_at").notNull().defaultNow()
|
|
28947
28972
|
},
|
|
@@ -28978,7 +29003,7 @@ var sectionValidationRuns = pgTable94(
|
|
|
28978
29003
|
commitSha: varchar71("commit_sha", { length: 64 }).notNull(),
|
|
28979
29004
|
fixtureHash: varchar71("fixture_hash", { length: 64 }).notNull(),
|
|
28980
29005
|
evidenceDigest: varchar71("evidence_digest", { length: 128 }).notNull(),
|
|
28981
|
-
results:
|
|
29006
|
+
results: jsonb54("results").$type().notNull(),
|
|
28982
29007
|
createdBy: text95("created_by"),
|
|
28983
29008
|
createdAt: timestamp87("created_at").notNull().defaultNow()
|
|
28984
29009
|
},
|
|
@@ -29105,7 +29130,7 @@ var sectionImplementationRequests = pgTable94(
|
|
|
29105
29130
|
name: "section_implementation_requests_validation_project_fkey"
|
|
29106
29131
|
}).onDelete("restrict"),
|
|
29107
29132
|
unique12("section_implementation_requests_id_project_unique").on(table.id, table.projectId),
|
|
29108
|
-
|
|
29133
|
+
uniqueIndex44("section_implementation_requests_one_active_unique").on(table.projectId, table.sectionDefinitionId, table.sectionVersion, table.schemaHash).where(sql28`${table.status} IN ('queued', 'dispatching', 'dispatched', 'running')`),
|
|
29109
29134
|
index81("section_implementation_requests_project_created_idx").on(table.projectId, table.createdAt)
|
|
29110
29135
|
]
|
|
29111
29136
|
);
|
|
@@ -29117,7 +29142,7 @@ var sectionZoneReleases = pgTable94(
|
|
|
29117
29142
|
projectId: text95("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
|
|
29118
29143
|
zoneId: text95("zone_id").notNull(),
|
|
29119
29144
|
revision: integer49("revision").notNull(),
|
|
29120
|
-
snapshot:
|
|
29145
|
+
snapshot: jsonb54("snapshot").$type().notNull(),
|
|
29121
29146
|
publishedBy: text95("published_by").notNull(),
|
|
29122
29147
|
publishedAt: timestamp87("published_at").notNull().defaultNow()
|
|
29123
29148
|
},
|
|
@@ -29138,7 +29163,7 @@ var sectionZoneReleases = pgTable94(
|
|
|
29138
29163
|
);
|
|
29139
29164
|
|
|
29140
29165
|
// src/schema/content_locks.ts
|
|
29141
|
-
import { check as check11, index as index82, jsonb as
|
|
29166
|
+
import { check as check11, index as index82, jsonb as jsonb55, pgTable as pgTable95, text as text96, timestamp as timestamp88 } from "drizzle-orm/pg-core";
|
|
29142
29167
|
import { sql as sql29 } from "drizzle-orm";
|
|
29143
29168
|
var CONTENT_LOCK_TARGET_KINDS = [
|
|
29144
29169
|
"page",
|
|
@@ -29158,7 +29183,7 @@ var contentLocks = pgTable95(
|
|
|
29158
29183
|
blockId: text96("block_id"),
|
|
29159
29184
|
// Deterministic structural path plus block ancestry captured when the lock is created.
|
|
29160
29185
|
// Nullable so Wave 5 remains compatible with locks created before this fingerprint existed.
|
|
29161
|
-
blockFingerprint:
|
|
29186
|
+
blockFingerprint: jsonb55("block_fingerprint").$type(),
|
|
29162
29187
|
fieldPath: text96("field_path").array(),
|
|
29163
29188
|
mode: text96("mode").$type().notNull().default("all"),
|
|
29164
29189
|
reason: text96("reason"),
|
|
@@ -29191,7 +29216,7 @@ import {
|
|
|
29191
29216
|
varchar as varchar72,
|
|
29192
29217
|
timestamp as timestamp89,
|
|
29193
29218
|
index as index83,
|
|
29194
|
-
uniqueIndex as
|
|
29219
|
+
uniqueIndex as uniqueIndex45
|
|
29195
29220
|
} from "drizzle-orm/pg-core";
|
|
29196
29221
|
import { sql as sql30 } from "drizzle-orm";
|
|
29197
29222
|
var projectTransfers = pgTable96(
|
|
@@ -29229,7 +29254,7 @@ var projectTransfers = pgTable96(
|
|
|
29229
29254
|
(table) => [
|
|
29230
29255
|
// At most one OPEN transfer per project. Partial-unique so completed/declined/
|
|
29231
29256
|
// cancelled/expired/failed rows never wedge a re-initiation.
|
|
29232
|
-
|
|
29257
|
+
uniqueIndex45("project_transfers_one_pending_idx").on(table.projectId).where(sql30`${table.status} = 'pending'`),
|
|
29233
29258
|
// Recipient inbox lookup (GET /me/transfers by email + status).
|
|
29234
29259
|
index83("project_transfers_recipient_idx").on(
|
|
29235
29260
|
table.recipientEmail,
|
|
@@ -29239,7 +29264,7 @@ var projectTransfers = pgTable96(
|
|
|
29239
29264
|
index83("project_transfers_from_ws_idx").on(table.fromWorkspaceId),
|
|
29240
29265
|
index83("project_transfers_project_idx").on(table.projectId),
|
|
29241
29266
|
// Magic-link resolution.
|
|
29242
|
-
|
|
29267
|
+
uniqueIndex45("project_transfers_token_idx").on(table.token),
|
|
29243
29268
|
// Expiry sweep — only pending rows are ever candidates.
|
|
29244
29269
|
index83("project_transfers_expires_idx").on(table.expiresAt).where(sql30`${table.status} = 'pending'`)
|
|
29245
29270
|
]
|
|
@@ -29252,7 +29277,7 @@ import {
|
|
|
29252
29277
|
varchar as varchar73,
|
|
29253
29278
|
integer as integer50,
|
|
29254
29279
|
bigint as bigint7,
|
|
29255
|
-
jsonb as
|
|
29280
|
+
jsonb as jsonb56,
|
|
29256
29281
|
timestamp as timestamp90,
|
|
29257
29282
|
index as index84
|
|
29258
29283
|
} from "drizzle-orm/pg-core";
|
|
@@ -29280,12 +29305,12 @@ var backups = pgTable97(
|
|
|
29280
29305
|
manifestVersion: integer50("manifest_version").notNull().default(1),
|
|
29281
29306
|
// forward-compat
|
|
29282
29307
|
sizeBytes: bigint7("size_bytes", { mode: "number" }),
|
|
29283
|
-
counts:
|
|
29308
|
+
counts: jsonb56("counts").$type().notNull().default({}),
|
|
29284
29309
|
// R2 object keys this snapshot references. Powers the media-GC hold:
|
|
29285
29310
|
// `list_backup_referenced_media_keys()` keeps these keys alive while the
|
|
29286
29311
|
// backup is live, so a restore never finds a garbage-collected object.
|
|
29287
|
-
mediaKeys:
|
|
29288
|
-
scope:
|
|
29312
|
+
mediaKeys: jsonb56("media_keys").$type().notNull().default([]),
|
|
29313
|
+
scope: jsonb56("scope").$type().notNull().default(FULL_BACKUP_SCOPE),
|
|
29289
29314
|
error: text98("error"),
|
|
29290
29315
|
createdBy: text98("created_by"),
|
|
29291
29316
|
// FK → users(id); NULL = system-initiated
|
|
@@ -29307,7 +29332,7 @@ import {
|
|
|
29307
29332
|
text as text99,
|
|
29308
29333
|
varchar as varchar74,
|
|
29309
29334
|
integer as integer51,
|
|
29310
|
-
jsonb as
|
|
29335
|
+
jsonb as jsonb57,
|
|
29311
29336
|
timestamp as timestamp91,
|
|
29312
29337
|
index as index85
|
|
29313
29338
|
} from "drizzle-orm/pg-core";
|
|
@@ -29327,7 +29352,7 @@ var backupJobs = pgTable98(
|
|
|
29327
29352
|
workingSince: timestamp91("working_since", { withTimezone: true }),
|
|
29328
29353
|
attempts: integer51("attempts").notNull().default(0),
|
|
29329
29354
|
error: text99("error"),
|
|
29330
|
-
payload:
|
|
29355
|
+
payload: jsonb57("payload").$type().notNull().default({}),
|
|
29331
29356
|
createdAt: timestamp91("created_at").notNull().defaultNow(),
|
|
29332
29357
|
updatedAt: timestamp91("updated_at").notNull().defaultNow()
|
|
29333
29358
|
},
|
|
@@ -29338,7 +29363,7 @@ var backupJobs = pgTable98(
|
|
|
29338
29363
|
);
|
|
29339
29364
|
|
|
29340
29365
|
// src/schema/clone_links.ts
|
|
29341
|
-
import { pgTable as pgTable99, text as text100, boolean as boolean31, jsonb as
|
|
29366
|
+
import { pgTable as pgTable99, text as text100, boolean as boolean31, jsonb as jsonb58, timestamp as timestamp92, index as index86 } from "drizzle-orm/pg-core";
|
|
29342
29367
|
var cloneLinks = pgTable99(
|
|
29343
29368
|
"clone_links",
|
|
29344
29369
|
{
|
|
@@ -29351,7 +29376,7 @@ var cloneLinks = pgTable99(
|
|
|
29351
29376
|
token: text100("token").notNull(),
|
|
29352
29377
|
// public share token (nanoid); unique among active links
|
|
29353
29378
|
enabled: boolean31("enabled").notNull().default(true),
|
|
29354
|
-
scope:
|
|
29379
|
+
scope: jsonb58("scope").$type().notNull(),
|
|
29355
29380
|
createdBy: text100("created_by"),
|
|
29356
29381
|
// FK → users(id); NULL = system-initiated
|
|
29357
29382
|
createdAt: timestamp92("created_at").notNull().defaultNow(),
|
|
@@ -29366,7 +29391,7 @@ var cloneLinks = pgTable99(
|
|
|
29366
29391
|
);
|
|
29367
29392
|
|
|
29368
29393
|
// src/schema/clone_jobs.ts
|
|
29369
|
-
import { pgTable as pgTable100, text as text101, varchar as varchar75, integer as integer52, jsonb as
|
|
29394
|
+
import { pgTable as pgTable100, text as text101, varchar as varchar75, integer as integer52, jsonb as jsonb59, timestamp as timestamp93, index as index87, uniqueIndex as uniqueIndex46 } from "drizzle-orm/pg-core";
|
|
29370
29395
|
import { sql as sql31 } from "drizzle-orm";
|
|
29371
29396
|
var cloneJobs = pgTable100(
|
|
29372
29397
|
"clone_jobs",
|
|
@@ -29387,7 +29412,7 @@ var cloneJobs = pgTable100(
|
|
|
29387
29412
|
workingSince: timestamp93("working_since", { withTimezone: true }),
|
|
29388
29413
|
attempts: integer52("attempts").notNull().default(0),
|
|
29389
29414
|
error: text101("error"),
|
|
29390
|
-
payload:
|
|
29415
|
+
payload: jsonb59("payload").$type().notNull().default({}),
|
|
29391
29416
|
// Which post-clone work the drain owes a finished job. 'clone' = none, today's behaviour.
|
|
29392
29417
|
// Migration 0343.
|
|
29393
29418
|
purpose: varchar75("purpose", { length: 32 }).notNull().default("clone"),
|
|
@@ -29401,7 +29426,7 @@ var cloneJobs = pgTable100(
|
|
|
29401
29426
|
index87("clone_jobs_workspace_idx").on(t.workspaceId),
|
|
29402
29427
|
// One unfinished hybrid→headless switch per source (0343). The route maps its 23505 to
|
|
29403
29428
|
// SWITCH_ALREADY_PENDING.
|
|
29404
|
-
|
|
29429
|
+
uniqueIndex46("clone_jobs_mode_switch_active_uniq").on(t.sourceProjectId).where(sql31`${t.purpose} = 'mode_switch' AND ${t.status} IN ('pending', 'working')`)
|
|
29405
29430
|
]
|
|
29406
29431
|
);
|
|
29407
29432
|
|
|
@@ -29413,7 +29438,7 @@ import {
|
|
|
29413
29438
|
varchar as varchar76,
|
|
29414
29439
|
timestamp as timestamp94,
|
|
29415
29440
|
index as index88,
|
|
29416
|
-
uniqueIndex as
|
|
29441
|
+
uniqueIndex as uniqueIndex47
|
|
29417
29442
|
} from "drizzle-orm/pg-core";
|
|
29418
29443
|
import { sql as sql32 } from "drizzle-orm";
|
|
29419
29444
|
var projectBranches = pgTable101(
|
|
@@ -29434,7 +29459,7 @@ var projectBranches = pgTable101(
|
|
|
29434
29459
|
},
|
|
29435
29460
|
(t) => [
|
|
29436
29461
|
index88("project_branches_project_idx").on(t.projectId),
|
|
29437
|
-
|
|
29462
|
+
uniqueIndex47("project_branches_project_slug_open_idx").on(t.projectId, t.slug).where(sql32`${t.status} = 'open'`)
|
|
29438
29463
|
]
|
|
29439
29464
|
);
|
|
29440
29465
|
var branchRowSyncs = pgTable101(
|
|
@@ -29454,7 +29479,7 @@ var branchRowSyncs = pgTable101(
|
|
|
29454
29479
|
);
|
|
29455
29480
|
|
|
29456
29481
|
// src/schema/branch_preview_share.ts
|
|
29457
|
-
import { pgTable as pgTable102, text as text103, boolean as boolean32, timestamp as timestamp95, index as index89, uniqueIndex as
|
|
29482
|
+
import { pgTable as pgTable102, text as text103, boolean as boolean32, timestamp as timestamp95, index as index89, uniqueIndex as uniqueIndex48 } from "drizzle-orm/pg-core";
|
|
29458
29483
|
var branchPreviewShares = pgTable102(
|
|
29459
29484
|
"branch_preview_shares",
|
|
29460
29485
|
{
|
|
@@ -29469,8 +29494,8 @@ var branchPreviewShares = pgTable102(
|
|
|
29469
29494
|
updatedAt: timestamp95("updated_at").notNull().defaultNow()
|
|
29470
29495
|
},
|
|
29471
29496
|
(t) => [
|
|
29472
|
-
|
|
29473
|
-
|
|
29497
|
+
uniqueIndex48("branch_preview_shares_branch_idx").on(t.branchId),
|
|
29498
|
+
uniqueIndex48("branch_preview_shares_active_token_idx").on(t.publicToken),
|
|
29474
29499
|
index89("branch_preview_shares_project_idx").on(t.projectId),
|
|
29475
29500
|
index89("branch_preview_shares_workspace_idx").on(t.workspaceId)
|
|
29476
29501
|
]
|
|
@@ -29487,7 +29512,7 @@ var branchPreviewGrants = pgTable102(
|
|
|
29487
29512
|
createdAt: timestamp95("created_at").notNull().defaultNow()
|
|
29488
29513
|
},
|
|
29489
29514
|
(t) => [
|
|
29490
|
-
|
|
29515
|
+
uniqueIndex48("branch_preview_grants_branch_email_idx").on(t.branchId, t.email),
|
|
29491
29516
|
index89("branch_preview_grants_project_idx").on(t.projectId)
|
|
29492
29517
|
]
|
|
29493
29518
|
);
|
|
@@ -29525,10 +29550,10 @@ import {
|
|
|
29525
29550
|
text as text105,
|
|
29526
29551
|
varchar as varchar77,
|
|
29527
29552
|
timestamp as timestamp97,
|
|
29528
|
-
jsonb as
|
|
29553
|
+
jsonb as jsonb60,
|
|
29529
29554
|
integer as integer53,
|
|
29530
29555
|
index as index91,
|
|
29531
|
-
uniqueIndex as
|
|
29556
|
+
uniqueIndex as uniqueIndex49
|
|
29532
29557
|
} from "drizzle-orm/pg-core";
|
|
29533
29558
|
import { relations as relations17 } from "drizzle-orm/relations";
|
|
29534
29559
|
import { sql as sql33 } from "drizzle-orm";
|
|
@@ -29553,7 +29578,7 @@ var templates = pgTable104(
|
|
|
29553
29578
|
thumbnail: varchar77("thumbnail", { length: 2048 }),
|
|
29554
29579
|
// Frozen snapshot manifest (stripped snapshot_project output). Never returned in
|
|
29555
29580
|
// list/gallery responses — only read server-side to instantiate.
|
|
29556
|
-
manifest:
|
|
29581
|
+
manifest: jsonb60("manifest").$type().notNull(),
|
|
29557
29582
|
visibility: varchar77("visibility", { length: 10 }).$type().notNull().default("private"),
|
|
29558
29583
|
sourceProjectId: text105("source_project_id"),
|
|
29559
29584
|
// provenance (nullable — source may be deleted later)
|
|
@@ -29569,7 +29594,7 @@ var templates = pgTable104(
|
|
|
29569
29594
|
index91("templates_workspace_idx").on(table.workspaceId),
|
|
29570
29595
|
// Partial: only live rows. A soft-deleted template frees its slug (mirrors
|
|
29571
29596
|
// components_ws_proj_slug_idx / migration 0114).
|
|
29572
|
-
|
|
29597
|
+
uniqueIndex49("templates_ws_slug_idx").on(table.workspaceId, table.slug).where(sql33`${table.deletedAt} IS NULL`),
|
|
29573
29598
|
// Public gallery scan (created_at DESC over live public rows).
|
|
29574
29599
|
index91("templates_public_idx").on(table.visibility).where(sql33`${table.visibility} = 'public' AND ${table.deletedAt} IS NULL`)
|
|
29575
29600
|
]
|
|
@@ -29641,7 +29666,7 @@ var planChanges = pgTable106(
|
|
|
29641
29666
|
);
|
|
29642
29667
|
|
|
29643
29668
|
// src/schema/billing_addons.ts
|
|
29644
|
-
import { pgTable as pgTable107, text as text108, varchar as varchar79, integer as integer55, boolean as boolean34, jsonb as
|
|
29669
|
+
import { pgTable as pgTable107, text as text108, varchar as varchar79, integer as integer55, boolean as boolean34, jsonb as jsonb61, index as index94 } from "drizzle-orm/pg-core";
|
|
29645
29670
|
var billingAddons = pgTable107(
|
|
29646
29671
|
"billing_addons",
|
|
29647
29672
|
{
|
|
@@ -29658,13 +29683,13 @@ var billingAddons = pgTable107(
|
|
|
29658
29683
|
// ai_credits packs only: credits granted per unit
|
|
29659
29684
|
recurring: boolean34("recurring").notNull().default(false),
|
|
29660
29685
|
// seats/localization/AB = true; credit packs = false
|
|
29661
|
-
metadata:
|
|
29686
|
+
metadata: jsonb61("metadata").$type().default({})
|
|
29662
29687
|
},
|
|
29663
29688
|
(t) => [index94("billing_addons_kind_idx").on(t.kind)]
|
|
29664
29689
|
);
|
|
29665
29690
|
|
|
29666
29691
|
// src/schema/billing_customers.ts
|
|
29667
|
-
import { pgTable as pgTable108, text as text109, varchar as varchar80, timestamp as timestamp100, uniqueIndex as
|
|
29692
|
+
import { pgTable as pgTable108, text as text109, varchar as varchar80, timestamp as timestamp100, uniqueIndex as uniqueIndex50 } from "drizzle-orm/pg-core";
|
|
29668
29693
|
var billingCustomers = pgTable108(
|
|
29669
29694
|
"billing_customers",
|
|
29670
29695
|
{
|
|
@@ -29678,13 +29703,13 @@ var billingCustomers = pgTable108(
|
|
|
29678
29703
|
updatedAt: timestamp100("updated_at").notNull().defaultNow()
|
|
29679
29704
|
},
|
|
29680
29705
|
(t) => [
|
|
29681
|
-
|
|
29682
|
-
|
|
29706
|
+
uniqueIndex50("billing_customers_workspace_idx").on(t.workspaceId),
|
|
29707
|
+
uniqueIndex50("billing_customers_dodo_idx").on(t.dodoCustomerId)
|
|
29683
29708
|
]
|
|
29684
29709
|
);
|
|
29685
29710
|
|
|
29686
29711
|
// src/schema/subscriptions.ts
|
|
29687
|
-
import { pgTable as pgTable109, text as text110, varchar as varchar81, boolean as boolean35, timestamp as timestamp101, index as index95, uniqueIndex as
|
|
29712
|
+
import { pgTable as pgTable109, text as text110, varchar as varchar81, boolean as boolean35, timestamp as timestamp101, index as index95, uniqueIndex as uniqueIndex51 } from "drizzle-orm/pg-core";
|
|
29688
29713
|
import { sql as sql34 } from "drizzle-orm";
|
|
29689
29714
|
var subscriptions = pgTable109(
|
|
29690
29715
|
"subscriptions",
|
|
@@ -29712,16 +29737,16 @@ var subscriptions = pgTable109(
|
|
|
29712
29737
|
},
|
|
29713
29738
|
(t) => [
|
|
29714
29739
|
index95("subscriptions_workspace_idx").on(t.workspaceId),
|
|
29715
|
-
|
|
29740
|
+
uniqueIndex51("subscriptions_dodo_idx").on(t.dodoSubscriptionId).where(sql34`${t.dodoSubscriptionId} IS NOT NULL`),
|
|
29716
29741
|
// At most one workspace-level subscription per workspace.
|
|
29717
|
-
|
|
29742
|
+
uniqueIndex51("subscriptions_workspace_plan_unique").on(t.workspaceId).where(sql34`${t.projectId} IS NULL`),
|
|
29718
29743
|
// At most one subscription per site.
|
|
29719
|
-
|
|
29744
|
+
uniqueIndex51("subscriptions_project_unique").on(t.projectId).where(sql34`${t.projectId} IS NOT NULL`)
|
|
29720
29745
|
]
|
|
29721
29746
|
);
|
|
29722
29747
|
|
|
29723
29748
|
// src/schema/subscription_addons.ts
|
|
29724
|
-
import { pgTable as pgTable110, text as text111, varchar as varchar82, integer as integer56, timestamp as timestamp102, index as index96, uniqueIndex as
|
|
29749
|
+
import { pgTable as pgTable110, text as text111, varchar as varchar82, integer as integer56, timestamp as timestamp102, index as index96, uniqueIndex as uniqueIndex52 } from "drizzle-orm/pg-core";
|
|
29725
29750
|
import { sql as sql35 } from "drizzle-orm";
|
|
29726
29751
|
var subscriptionAddons = pgTable110(
|
|
29727
29752
|
"subscription_addons",
|
|
@@ -29742,12 +29767,12 @@ var subscriptionAddons = pgTable110(
|
|
|
29742
29767
|
},
|
|
29743
29768
|
(t) => [
|
|
29744
29769
|
index96("subscription_addons_workspace_idx").on(t.workspaceId),
|
|
29745
|
-
|
|
29770
|
+
uniqueIndex52("subscription_addons_dodo_idx").on(t.dodoSubscriptionId).where(sql35`${t.dodoSubscriptionId} IS NOT NULL`)
|
|
29746
29771
|
]
|
|
29747
29772
|
);
|
|
29748
29773
|
|
|
29749
29774
|
// src/schema/billing_alerts.ts
|
|
29750
|
-
import { pgTable as pgTable111, text as text112, varchar as varchar83, timestamp as timestamp103, index as index97, uniqueIndex as
|
|
29775
|
+
import { pgTable as pgTable111, text as text112, varchar as varchar83, timestamp as timestamp103, index as index97, uniqueIndex as uniqueIndex53 } from "drizzle-orm/pg-core";
|
|
29751
29776
|
var billingAlerts = pgTable111(
|
|
29752
29777
|
"billing_alerts",
|
|
29753
29778
|
{
|
|
@@ -29767,13 +29792,13 @@ var billingAlerts = pgTable111(
|
|
|
29767
29792
|
sentAt: timestamp103("sent_at", { withTimezone: true }).notNull().defaultNow()
|
|
29768
29793
|
},
|
|
29769
29794
|
(t) => [
|
|
29770
|
-
|
|
29795
|
+
uniqueIndex53("billing_alerts_dedupe_idx").on(t.dedupeKey),
|
|
29771
29796
|
index97("billing_alerts_workspace_idx").on(t.workspaceId, t.sentAt)
|
|
29772
29797
|
]
|
|
29773
29798
|
);
|
|
29774
29799
|
|
|
29775
29800
|
// src/schema/ai_credit_ledger.ts
|
|
29776
|
-
import { pgTable as pgTable112, text as text113, varchar as varchar84, integer as integer57, timestamp as timestamp104, index as index98, uniqueIndex as
|
|
29801
|
+
import { pgTable as pgTable112, text as text113, varchar as varchar84, integer as integer57, timestamp as timestamp104, index as index98, uniqueIndex as uniqueIndex54 } from "drizzle-orm/pg-core";
|
|
29777
29802
|
import { sql as sql36 } from "drizzle-orm";
|
|
29778
29803
|
var aiCreditLedger = pgTable112(
|
|
29779
29804
|
"ai_credit_ledger",
|
|
@@ -29793,7 +29818,7 @@ var aiCreditLedger = pgTable112(
|
|
|
29793
29818
|
},
|
|
29794
29819
|
(t) => [
|
|
29795
29820
|
index98("ai_credit_ledger_workspace_idx").on(t.workspaceId, t.createdAt),
|
|
29796
|
-
|
|
29821
|
+
uniqueIndex54("ai_credit_ledger_custom_agent_run_unique").on(t.note).where(sql36`${t.reason} = 'consume' AND ${t.note} LIKE 'custom-agent-run:%'`)
|
|
29797
29822
|
]
|
|
29798
29823
|
);
|
|
29799
29824
|
|
|
@@ -29804,7 +29829,7 @@ import {
|
|
|
29804
29829
|
varchar as varchar85,
|
|
29805
29830
|
timestamp as timestamp105,
|
|
29806
29831
|
boolean as boolean36,
|
|
29807
|
-
jsonb as
|
|
29832
|
+
jsonb as jsonb62,
|
|
29808
29833
|
index as index99
|
|
29809
29834
|
} from "drizzle-orm/pg-core";
|
|
29810
29835
|
var supportTickets = pgTable113(
|
|
@@ -29840,7 +29865,7 @@ var supportTickets = pgTable113(
|
|
|
29840
29865
|
// hence the partial unique index rather than a unique column.
|
|
29841
29866
|
plainThreadId: text114("plain_thread_id"),
|
|
29842
29867
|
// Files attached when the case was opened, before any message row exists.
|
|
29843
|
-
attachments:
|
|
29868
|
+
attachments: jsonb62("attachments").$type().notNull().default([]),
|
|
29844
29869
|
createdAt: timestamp105("created_at").notNull().defaultNow(),
|
|
29845
29870
|
updatedAt: timestamp105("updated_at").notNull().defaultNow()
|
|
29846
29871
|
},
|
|
@@ -29871,7 +29896,7 @@ var supportTicketMessages = pgTable113(
|
|
|
29871
29896
|
// channels whose mutation returns no entry id — replyToThread returns only an error
|
|
29872
29897
|
// slot, which is why the echo check keys on the actor and this is the backstop.
|
|
29873
29898
|
plainMessageId: text114("plain_message_id"),
|
|
29874
|
-
attachments:
|
|
29899
|
+
attachments: jsonb62("attachments").$type().notNull().default([]),
|
|
29875
29900
|
createdAt: timestamp105("created_at").notNull().defaultNow()
|
|
29876
29901
|
},
|
|
29877
29902
|
(table) => [
|
|
@@ -29884,7 +29909,7 @@ import {
|
|
|
29884
29909
|
pgTable as pgTable114,
|
|
29885
29910
|
text as text115,
|
|
29886
29911
|
varchar as varchar86,
|
|
29887
|
-
jsonb as
|
|
29912
|
+
jsonb as jsonb63,
|
|
29888
29913
|
timestamp as timestamp106,
|
|
29889
29914
|
index as index100
|
|
29890
29915
|
} from "drizzle-orm/pg-core";
|
|
@@ -29905,7 +29930,7 @@ var adminActionLogs = pgTable114(
|
|
|
29905
29930
|
// workspace | user | plan | ticket
|
|
29906
29931
|
targetId: text115("target_id"),
|
|
29907
29932
|
reason: text115("reason"),
|
|
29908
|
-
metadata:
|
|
29933
|
+
metadata: jsonb63("metadata").$type().notNull().default({}),
|
|
29909
29934
|
ipAddress: text115("ip_address"),
|
|
29910
29935
|
createdAt: timestamp106("created_at").notNull().defaultNow()
|
|
29911
29936
|
},
|
|
@@ -30002,7 +30027,7 @@ import {
|
|
|
30002
30027
|
varchar as varchar90,
|
|
30003
30028
|
timestamp as timestamp110,
|
|
30004
30029
|
index as index104,
|
|
30005
|
-
uniqueIndex as
|
|
30030
|
+
uniqueIndex as uniqueIndex55
|
|
30006
30031
|
} from "drizzle-orm/pg-core";
|
|
30007
30032
|
var ENV_VAR_SCOPES = ["production", "preview", "development"];
|
|
30008
30033
|
var projectEnvVars = pgTable118(
|
|
@@ -30025,7 +30050,7 @@ var projectEnvVars = pgTable118(
|
|
|
30025
30050
|
},
|
|
30026
30051
|
(table) => [
|
|
30027
30052
|
// One value per key per scope — the same key MAY exist in production and preview.
|
|
30028
|
-
|
|
30053
|
+
uniqueIndex55("project_env_vars_project_key_scope_idx").on(
|
|
30029
30054
|
table.projectId,
|
|
30030
30055
|
table.key,
|
|
30031
30056
|
table.scope
|
|
@@ -30035,7 +30060,7 @@ var projectEnvVars = pgTable118(
|
|
|
30035
30060
|
);
|
|
30036
30061
|
|
|
30037
30062
|
// src/schema/mcp_connections.ts
|
|
30038
|
-
import { pgTable as pgTable119, text as text120, varchar as varchar91, jsonb as
|
|
30063
|
+
import { pgTable as pgTable119, text as text120, varchar as varchar91, jsonb as jsonb64, timestamp as timestamp111, index as index105, uniqueIndex as uniqueIndex56 } from "drizzle-orm/pg-core";
|
|
30039
30064
|
import { sql as sql37 } from "drizzle-orm";
|
|
30040
30065
|
var mcpConnections = pgTable119(
|
|
30041
30066
|
"mcp_connections",
|
|
@@ -30070,14 +30095,14 @@ var mcpConnections = pgTable119(
|
|
|
30070
30095
|
oauthState: text120("oauth_state"),
|
|
30071
30096
|
pkceVerifierEnc: text120("pkce_verifier_enc"),
|
|
30072
30097
|
/** Discovery output: authorization server metadata, token endpoint, RFC 8707 resource. */
|
|
30073
|
-
authMetadata:
|
|
30098
|
+
authMetadata: jsonb64("auth_metadata").$type(),
|
|
30074
30099
|
scopes: text120("scopes").array().$type(),
|
|
30075
30100
|
/**
|
|
30076
30101
|
* Full descriptors (name, description, inputSchema, annotations) — NOT just names. The
|
|
30077
30102
|
* read-only boundary is decided from `annotations.readOnlyHint`, so the names alone would
|
|
30078
30103
|
* force a live listTools on the turn path to answer a governance question.
|
|
30079
30104
|
*/
|
|
30080
|
-
toolsCache:
|
|
30105
|
+
toolsCache: jsonb64("tools_cache").$type().notNull().default([]),
|
|
30081
30106
|
toolsCachedAt: timestamp111("tools_cached_at", { withTimezone: true }),
|
|
30082
30107
|
/**
|
|
30083
30108
|
* pending | ok | invalid | revoked. `pending` is the pre-consent row; `invalid` is set on a
|
|
@@ -30099,7 +30124,7 @@ var mcpConnections = pgTable119(
|
|
|
30099
30124
|
index105("mcp_connections_project_idx").on(t.projectId),
|
|
30100
30125
|
// Reconnecting a catalog provider UPDATEs rather than accumulating a second live credential.
|
|
30101
30126
|
// Custom connectors are excluded: a project may legitimately add many distinct MCP servers.
|
|
30102
|
-
|
|
30127
|
+
uniqueIndex56("mcp_connections_project_provider_unique").on(t.projectId, t.providerSlug).where(sql37`deleted_at IS NULL AND provider_slug <> 'custom'`)
|
|
30103
30128
|
]
|
|
30104
30129
|
);
|
|
30105
30130
|
|
|
@@ -30109,9 +30134,9 @@ import {
|
|
|
30109
30134
|
text as text121,
|
|
30110
30135
|
timestamp as timestamp112,
|
|
30111
30136
|
boolean as boolean38,
|
|
30112
|
-
jsonb as
|
|
30137
|
+
jsonb as jsonb65,
|
|
30113
30138
|
integer as integer59,
|
|
30114
|
-
uniqueIndex as
|
|
30139
|
+
uniqueIndex as uniqueIndex57
|
|
30115
30140
|
} from "drizzle-orm/pg-core";
|
|
30116
30141
|
var crmConnections = pgTable120(
|
|
30117
30142
|
"crm_connections",
|
|
@@ -30131,7 +30156,7 @@ var crmConnections = pgTable120(
|
|
|
30131
30156
|
updatedAt: timestamp112("updated_at").notNull().defaultNow()
|
|
30132
30157
|
},
|
|
30133
30158
|
(t) => [
|
|
30134
|
-
|
|
30159
|
+
uniqueIndex57("crm_connection_account_uq").on(
|
|
30135
30160
|
t.workspaceId,
|
|
30136
30161
|
t.provider,
|
|
30137
30162
|
t.accountId
|
|
@@ -30157,8 +30182,8 @@ var formIntegrationDeliveries = pgTable120(
|
|
|
30157
30182
|
integrationId: text121("integration_id").notNull(),
|
|
30158
30183
|
eventId: text121("event_id").notNull(),
|
|
30159
30184
|
submissionId: text121("submission_id").notNull(),
|
|
30160
|
-
snapshot:
|
|
30161
|
-
data:
|
|
30185
|
+
snapshot: jsonb65("snapshot").$type().notNull(),
|
|
30186
|
+
data: jsonb65("data").$type().notNull(),
|
|
30162
30187
|
status: text121("status").notNull().default("queued"),
|
|
30163
30188
|
attempts: integer59("attempts").notNull().default(0),
|
|
30164
30189
|
lastError: text121("last_error"),
|
|
@@ -30169,7 +30194,7 @@ var formIntegrationDeliveries = pgTable120(
|
|
|
30169
30194
|
updatedAt: timestamp112("updated_at").notNull().defaultNow()
|
|
30170
30195
|
},
|
|
30171
30196
|
(t) => [
|
|
30172
|
-
|
|
30197
|
+
uniqueIndex57("crm_delivery_event_uq").on(
|
|
30173
30198
|
t.workspaceId,
|
|
30174
30199
|
t.eventId,
|
|
30175
30200
|
t.integrationId
|
|
@@ -31009,6 +31034,7 @@ export {
|
|
|
31009
31034
|
publicWorkspaceBySlug,
|
|
31010
31035
|
publishDeliveries,
|
|
31011
31036
|
publishItems,
|
|
31037
|
+
publishValueOutcomes,
|
|
31012
31038
|
publishes,
|
|
31013
31039
|
qaReports,
|
|
31014
31040
|
queries,
|