@allbluecn/database 0.14.8 → 0.14.10

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.
@@ -168,7 +168,14 @@ export type * from './models/HarnessScheduleOccurrence.ts'
168
168
  export type * from './models/HarnessOutbox.ts'
169
169
  export type * from './models/HarnessFeedback.ts'
170
170
  export type * from './models/HarnessMcpServer.ts'
171
+ export type * from './models/HarnessSshHost.ts'
171
172
  export type * from './models/HarnessConnectorAccount.ts'
172
173
  export type * from './models/HarnessSessionSearchDocument.ts'
173
174
  export type * from './models/HarnessSessionSearchToken.ts'
175
+ export type * from './models/HarnessForgeBinding.ts'
176
+ export type * from './models/HarnessWorktree.ts'
177
+ export type * from './models/HarnessPluginMarketSource.ts'
178
+ export type * from './models/HarnessPluginVersionExemption.ts'
179
+ export type * from './models/HarnessTelemetrySettings.ts'
180
+ export type * from './models/HarnessTelemetryUpload.ts'
174
181
  export type * from './commonInputTypes.ts'
@@ -0,0 +1,32 @@
1
+ -- AlterTable
2
+ ALTER TABLE "chat_threads" ADD COLUMN "sshHostId" TEXT;
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "harness_ssh_hosts" (
6
+ "id" TEXT NOT NULL,
7
+ "userId" TEXT NOT NULL,
8
+ "name" TEXT NOT NULL,
9
+ "host" TEXT NOT NULL,
10
+ "port" INTEGER NOT NULL DEFAULT 22,
11
+ "username" TEXT NOT NULL,
12
+ "authMethod" TEXT NOT NULL,
13
+ "credentialId" TEXT NOT NULL,
14
+ "pinnedFingerprint" TEXT NOT NULL,
15
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
16
+ "updatedAt" TIMESTAMP(3) NOT NULL,
17
+
18
+ CONSTRAINT "harness_ssh_hosts_pkey" PRIMARY KEY ("id")
19
+ );
20
+
21
+ -- CreateIndex
22
+ CREATE INDEX "harness_ssh_hosts_userId_idx" ON "harness_ssh_hosts"("userId");
23
+
24
+ -- CreateIndex
25
+ CREATE UNIQUE INDEX "harness_ssh_hosts_userId_name_key" ON "harness_ssh_hosts"("userId", "name");
26
+
27
+ -- AddForeignKey
28
+ ALTER TABLE "chat_threads" ADD CONSTRAINT "chat_threads_sshHostId_fkey" FOREIGN KEY ("sshHostId") REFERENCES "harness_ssh_hosts"("id") ON DELETE SET NULL ON UPDATE CASCADE;
29
+
30
+ -- AddForeignKey
31
+ ALTER TABLE "harness_ssh_hosts" ADD CONSTRAINT "harness_ssh_hosts_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
32
+
@@ -0,0 +1,104 @@
1
+ -- P4 任务 17 一次性迁移:Forge 绑定 / worktree 生命周期 / 插件市场索引源 / 版本豁免。
2
+ -- 由 `prisma migrate diff --from-config-datasource --to-schema` 生成后仅保留本四模型
3
+ -- 的加法段(Prisma 7 会把迁移链中的 raw 表(sync_change_log/sync_applied_ops/
4
+ -- sync_version 列、memory_facts)推导为 DROP——团队既定方案不把该 DROP 写入迁移,
5
+ -- 见 packages/AGENTS.md「Prisma 7 raw 表」节与 db-migration-check.yml 白名单)。
6
+
7
+ -- CreateTable
8
+ CREATE TABLE "harness_forge_bindings" (
9
+ "id" TEXT NOT NULL,
10
+ "userId" TEXT NOT NULL,
11
+ "provider" TEXT NOT NULL,
12
+ "accountLabel" TEXT NOT NULL,
13
+ "scopeType" TEXT NOT NULL DEFAULT 'user',
14
+ "scopeName" TEXT,
15
+ "repoWhitelist" JSONB,
16
+ "credentialRef" TEXT NOT NULL,
17
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
18
+ "updatedAt" TIMESTAMP(3) NOT NULL,
19
+
20
+ CONSTRAINT "harness_forge_bindings_pkey" PRIMARY KEY ("id")
21
+ );
22
+
23
+ -- CreateTable
24
+ CREATE TABLE "harness_worktrees" (
25
+ "id" TEXT NOT NULL,
26
+ "userId" TEXT NOT NULL,
27
+ "threadId" TEXT NOT NULL,
28
+ "path" TEXT NOT NULL,
29
+ "baseBranch" TEXT NOT NULL,
30
+ "headBranch" TEXT NOT NULL,
31
+ "status" TEXT NOT NULL DEFAULT 'active',
32
+ "removedAt" TIMESTAMP(3),
33
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
34
+ "updatedAt" TIMESTAMP(3) NOT NULL,
35
+
36
+ CONSTRAINT "harness_worktrees_pkey" PRIMARY KEY ("id")
37
+ );
38
+
39
+ -- CreateTable
40
+ CREATE TABLE "harness_plugin_market_sources" (
41
+ "id" TEXT NOT NULL,
42
+ "userId" TEXT NOT NULL,
43
+ "name" TEXT NOT NULL,
44
+ "url" TEXT NOT NULL,
45
+ "enabled" BOOLEAN NOT NULL DEFAULT true,
46
+ "priority" INTEGER NOT NULL DEFAULT 0,
47
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
48
+ "updatedAt" TIMESTAMP(3) NOT NULL,
49
+
50
+ CONSTRAINT "harness_plugin_market_sources_pkey" PRIMARY KEY ("id")
51
+ );
52
+
53
+ -- CreateTable
54
+ CREATE TABLE "harness_plugin_version_exemptions" (
55
+ "id" TEXT NOT NULL,
56
+ "userId" TEXT NOT NULL,
57
+ "pluginName" TEXT NOT NULL,
58
+ "versionRange" TEXT NOT NULL,
59
+ "reason" TEXT NOT NULL,
60
+ "expiresAt" TIMESTAMP(3),
61
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
62
+ "updatedAt" TIMESTAMP(3) NOT NULL,
63
+
64
+ CONSTRAINT "harness_plugin_version_exemptions_pkey" PRIMARY KEY ("id")
65
+ );
66
+
67
+ -- CreateIndex
68
+ CREATE INDEX "harness_forge_bindings_userId_idx" ON "harness_forge_bindings"("userId");
69
+
70
+ -- CreateIndex
71
+ CREATE UNIQUE INDEX "harness_forge_bindings_userId_provider_accountLabel_key" ON "harness_forge_bindings"("userId", "provider", "accountLabel");
72
+
73
+ -- CreateIndex
74
+ CREATE INDEX "harness_worktrees_userId_status_idx" ON "harness_worktrees"("userId", "status");
75
+
76
+ -- CreateIndex
77
+ CREATE INDEX "harness_worktrees_threadId_status_idx" ON "harness_worktrees"("threadId", "status");
78
+
79
+ -- CreateIndex
80
+ CREATE UNIQUE INDEX "harness_worktrees_userId_threadId_path_key" ON "harness_worktrees"("userId", "threadId", "path");
81
+
82
+ -- CreateIndex
83
+ CREATE INDEX "harness_plugin_market_sources_userId_enabled_idx" ON "harness_plugin_market_sources"("userId", "enabled");
84
+
85
+ -- CreateIndex
86
+ CREATE UNIQUE INDEX "harness_plugin_market_sources_userId_name_key" ON "harness_plugin_market_sources"("userId", "name");
87
+
88
+ -- CreateIndex
89
+ CREATE INDEX "harness_plugin_version_exemptions_userId_pluginName_idx" ON "harness_plugin_version_exemptions"("userId", "pluginName");
90
+
91
+ -- CreateIndex
92
+ CREATE UNIQUE INDEX "harness_plugin_version_exemptions_userId_pluginName_version_key" ON "harness_plugin_version_exemptions"("userId", "pluginName", "versionRange");
93
+
94
+ -- AddForeignKey
95
+ ALTER TABLE "harness_forge_bindings" ADD CONSTRAINT "harness_forge_bindings_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
96
+
97
+ -- AddForeignKey
98
+ ALTER TABLE "harness_worktrees" ADD CONSTRAINT "harness_worktrees_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
99
+
100
+ -- AddForeignKey
101
+ ALTER TABLE "harness_plugin_market_sources" ADD CONSTRAINT "harness_plugin_market_sources_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
102
+
103
+ -- AddForeignKey
104
+ ALTER TABLE "harness_plugin_version_exemptions" ADD CONSTRAINT "harness_plugin_version_exemptions_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;