@highstate/backend 0.9.26 → 0.9.28

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.
Files changed (99) hide show
  1. package/dist/{chunk-GJTMJQUW.js → chunk-QSHSXLO2.js} +18 -9
  2. package/dist/chunk-QSHSXLO2.js.map +1 -0
  3. package/dist/index.js +292 -132
  4. package/dist/index.js.map +1 -1
  5. package/dist/shared/index.js +1 -1
  6. package/package.json +3 -3
  7. package/prisma/backend/_schema/layout.prisma +3 -1
  8. package/prisma/backend/_schema/project.prisma +4 -2
  9. package/prisma/backend/_schema/unlock-method.prisma +19 -0
  10. package/prisma/backend/sqlite/migrations/{20250818082732_add_models → 20250928124105_initial_migration}/migration.sql +48 -16
  11. package/prisma/project/api-key.prisma +3 -1
  12. package/prisma/project/artifact.prisma +2 -2
  13. package/prisma/project/custom-status.prisma +1 -1
  14. package/prisma/project/layout.prisma +4 -0
  15. package/prisma/project/migrations/{20250816081310_initial → 20250928130725_initial_migration}/migration.sql +132 -46
  16. package/prisma/project/terminal.prisma +2 -2
  17. package/prisma/project/unlock-method.prisma +1 -1
  18. package/prisma/project/worker.prisma +1 -1
  19. package/src/business/backend-unlock.test.ts +133 -0
  20. package/src/business/backend-unlock.ts +76 -0
  21. package/src/business/index.ts +1 -0
  22. package/src/business/settings.test.ts +3 -2
  23. package/src/database/_generated/backend/postgresql/client.ts +9 -4
  24. package/src/database/_generated/backend/postgresql/internal/class.ts +147 -168
  25. package/src/database/_generated/backend/postgresql/internal/prismaNamespace.ts +127 -40
  26. package/src/database/_generated/backend/postgresql/models/BackendUnlockMethod.ts +1156 -0
  27. package/src/database/_generated/backend/postgresql/models/Project.ts +2 -2
  28. package/src/database/_generated/backend/postgresql/models/ProjectSpace.ts +7 -1
  29. package/src/database/_generated/backend/postgresql/models/UserWorkspaceLayout.ts +1067 -0
  30. package/src/database/_generated/backend/postgresql/models.ts +2 -1
  31. package/src/database/_generated/backend/sqlite/client.ts +9 -4
  32. package/src/database/_generated/backend/sqlite/internal/class.ts +146 -165
  33. package/src/database/_generated/backend/sqlite/internal/prismaNamespace.ts +127 -40
  34. package/src/database/_generated/backend/sqlite/models/BackendUnlockMethod.ts +1154 -0
  35. package/src/database/_generated/backend/sqlite/models/Project.ts +2 -2
  36. package/src/database/_generated/backend/sqlite/models/ProjectSpace.ts +7 -1
  37. package/src/database/_generated/backend/sqlite/models/UserWorkspaceLayout.ts +1065 -0
  38. package/src/database/_generated/backend/sqlite/models.ts +2 -1
  39. package/src/database/_generated/project/commonInputTypes.ts +26 -26
  40. package/src/database/_generated/project/internal/class.ts +7 -8
  41. package/src/database/_generated/project/internal/prismaNamespace.ts +8 -7
  42. package/src/database/_generated/project/models/ApiKey.ts +2 -0
  43. package/src/database/_generated/project/models/Artifact.ts +2 -2
  44. package/src/database/_generated/project/models/InstanceCustomStatus.ts +1 -1
  45. package/src/database/_generated/project/models/OperationLog.ts +49 -1
  46. package/src/database/_generated/project/models/UnlockMethod.ts +2 -2
  47. package/src/database/_generated/project/models/UserCompositeViewport.ts +16 -14
  48. package/src/database/_generated/project/models/UserProjectViewport.ts +11 -9
  49. package/src/database/_generated/project/models/WorkerVersion.ts +1 -5
  50. package/src/database/abstractions.ts +25 -3
  51. package/src/database/factory.ts +5 -6
  52. package/src/database/local/backend.ts +148 -18
  53. package/src/database/manager.ts +30 -2
  54. package/src/database/prisma.ts +1 -0
  55. package/src/orchestrator/operation-plan.ts +0 -19
  56. package/src/orchestrator/operation.ts +21 -4
  57. package/src/services.ts +12 -3
  58. package/src/shared/models/backend/unlock-method.ts +7 -13
  59. package/src/shared/models/errors.ts +14 -0
  60. package/src/shared/models/prisma.ts +10 -2
  61. package/src/test-utils/database.ts +34 -6
  62. package/dist/chunk-GJTMJQUW.js.map +0 -1
  63. package/prisma/backend/sqlite/migrations/20250817070609_initiial/migration.sql +0 -34
  64. package/prisma/backend/sqlite/migrations/20250817104948_add_fields/migration.sql +0 -59
  65. package/prisma/backend/sqlite/migrations/20250818083106_a/migration.sql +0 -19
  66. package/prisma/backend/sqlite/migrations/20250818101945_hi/migration.sql +0 -1
  67. package/prisma/backend/sqlite/migrations/20250819082315_a/migration.sql +0 -5
  68. package/prisma/project/migrations/20250816082523_test/migration.sql +0 -72
  69. package/prisma/project/migrations/20250818065643_update/migration.sql +0 -42
  70. package/prisma/project/migrations/20250818070758_a/migration.sql +0 -8
  71. package/prisma/project/migrations/20250818070913_a/migration.sql +0 -8
  72. package/prisma/project/migrations/20250818082720_add_motels/migration.sql +0 -11
  73. package/prisma/project/migrations/20250818112523_hello/migration.sql +0 -35
  74. package/prisma/project/migrations/20250819082305_a/migration.sql +0 -14
  75. package/prisma/project/migrations/20250819165004_add_missing_fields/migration.sql +0 -216
  76. package/prisma/project/migrations/20250819171309_a/migration.sql +0 -22
  77. package/prisma/project/migrations/20250820113949_a/migration.sql +0 -66
  78. package/prisma/project/migrations/20250820144256_b/migration.sql +0 -31
  79. package/prisma/project/migrations/20250820145547_a/migration.sql +0 -24
  80. package/prisma/project/migrations/20250820182517_b/migration.sql +0 -2
  81. package/prisma/project/migrations/20250821172324_a/migration.sql +0 -2
  82. package/prisma/project/migrations/20250822081339_a/migration.sql +0 -219
  83. package/prisma/project/migrations/20250822083742_b/migration.sql +0 -1
  84. package/prisma/project/migrations/20250822105134_boom/migration.sql +0 -1
  85. package/prisma/project/migrations/20250822141028_b/migration.sql +0 -1
  86. package/prisma/project/migrations/20250822142342_b/migration.sql +0 -16
  87. package/prisma/project/migrations/20250824072720_a/migration.sql +0 -1
  88. package/prisma/project/migrations/20250824093656_b/migration.sql +0 -21
  89. package/prisma/project/migrations/20250825082518_a/migration.sql +0 -1
  90. package/prisma/project/migrations/20250825085343_b/migration.sql +0 -1
  91. package/prisma/project/migrations/20250825091312_a/migration.sql +0 -1
  92. package/prisma/project/migrations/20250903095431_hi/migration.sql +0 -44
  93. package/prisma/project/migrations/20250903174255_a/migration.sql +0 -24
  94. package/prisma/project/migrations/20250908095205_hi/migration.sql +0 -18
  95. package/prisma/project/migrations/20250909155857_hi/migration.sql +0 -15
  96. package/prisma/project/migrations/20250921092621_b/migration.sql +0 -33
  97. package/prisma/project/migrations/20250921093911_b/migration.sql +0 -1
  98. package/src/database/_generated/backend/postgresql/models/UserWorkspaseLayout.ts +0 -1065
  99. package/src/database/_generated/backend/sqlite/models/UserWorkspaseLayout.ts +0 -1063
@@ -1,14 +0,0 @@
1
- -- CreateTable
2
- CREATE TABLE "UserProjectViewport" (
3
- "userId" TEXT NOT NULL PRIMARY KEY,
4
- "viewport" JSONB NOT NULL
5
- );
6
-
7
- -- CreateTable
8
- CREATE TABLE "UserCompositeViewport" (
9
- "userId" TEXT NOT NULL,
10
- "instanceId" TEXT NOT NULL,
11
- "viewport" JSONB NOT NULL,
12
-
13
- PRIMARY KEY ("userId", "instanceId")
14
- );
@@ -1,216 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - The primary key for the `InstanceCustomStatus` table will be changed. If it partially fails, the table could be left without primary key constraint.
5
- - You are about to drop the column `completedAt` on the `Operation` table. All the data in the column will be lost.
6
- - Added the required column `updatedAt` to the `ApiKey` table without a default value. This is not possible if the table is not empty.
7
- - Added the required column `updatedAt` to the `HubModel` table without a default value. This is not possible if the table is not empty.
8
- - Added the required column `serviceAccountId` to the `InstanceCustomStatus` table without a default value. This is not possible if the table is not empty.
9
- - Added the required column `updatedAt` to the `InstanceCustomStatus` table without a default value. This is not possible if the table is not empty.
10
- - Added the required column `startedAt` to the `InstanceEvaluationState` table without a default value. This is not possible if the table is not empty.
11
- - Added the required column `updatedAt` to the `InstanceModel` table without a default value. This is not possible if the table is not empty.
12
- - Added the required column `updatedAt` to the `Operation` table without a default value. This is not possible if the table is not empty.
13
- - Added the required column `updatedAt` to the `Page` table without a default value. This is not possible if the table is not empty.
14
- - Added the required column `updatedAt` to the `Secret` table without a default value. This is not possible if the table is not empty.
15
- - Added the required column `updatedAt` to the `ServiceAccount` table without a default value. This is not possible if the table is not empty.
16
- - Added the required column `updatedAt` to the `Terminal` table without a default value. This is not possible if the table is not empty.
17
- - Added the required column `updatedAt` to the `Trigger` table without a default value. This is not possible if the table is not empty.
18
- - Added the required column `updatedAt` to the `UnlockMethod` table without a default value. This is not possible if the table is not empty.
19
- - Added the required column `meta` to the `WorkerVersion` table without a default value. This is not possible if the table is not empty.
20
- - Added the required column `updatedAt` to the `WorkerVersion` table without a default value. This is not possible if the table is not empty.
21
-
22
- */
23
- -- AlterTable
24
- ALTER TABLE "InstanceOperationState" ADD COLUMN "finishedAt" DATETIME;
25
- ALTER TABLE "InstanceOperationState" ADD COLUMN "startedAt" DATETIME;
26
-
27
- -- RedefineTables
28
- PRAGMA defer_foreign_keys=ON;
29
- PRAGMA foreign_keys=OFF;
30
- CREATE TABLE "new_ApiKey" (
31
- "id" TEXT NOT NULL PRIMARY KEY,
32
- "meta" JSONB NOT NULL,
33
- "scopes" JSONB NOT NULL,
34
- "token" TEXT NOT NULL,
35
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
36
- "updatedAt" DATETIME NOT NULL
37
- );
38
- INSERT INTO "new_ApiKey" ("id", "meta", "scopes", "token") SELECT "id", "meta", "scopes", "token" FROM "ApiKey";
39
- DROP TABLE "ApiKey";
40
- ALTER TABLE "new_ApiKey" RENAME TO "ApiKey";
41
- CREATE UNIQUE INDEX "ApiKey_token_key" ON "ApiKey"("token");
42
- CREATE TABLE "new_HubModel" (
43
- "id" TEXT NOT NULL PRIMARY KEY,
44
- "model" JSONB NOT NULL,
45
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
46
- "updatedAt" DATETIME NOT NULL
47
- );
48
- INSERT INTO "new_HubModel" ("id", "model") SELECT "id", "model" FROM "HubModel";
49
- DROP TABLE "HubModel";
50
- ALTER TABLE "new_HubModel" RENAME TO "HubModel";
51
- CREATE TABLE "new_InstanceCustomStatus" (
52
- "instanceId" TEXT NOT NULL,
53
- "serviceAccountId" TEXT NOT NULL,
54
- "name" TEXT NOT NULL,
55
- "meta" JSONB NOT NULL,
56
- "value" TEXT NOT NULL,
57
- "message" TEXT,
58
- "order" INTEGER NOT NULL DEFAULT 50,
59
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
60
- "updatedAt" DATETIME NOT NULL,
61
-
62
- PRIMARY KEY ("instanceId", "serviceAccountId", "name"),
63
- CONSTRAINT "InstanceCustomStatus_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
64
- CONSTRAINT "InstanceCustomStatus_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
65
- );
66
- INSERT INTO "new_InstanceCustomStatus" ("instanceId", "message", "meta", "name", "order", "value") SELECT "instanceId", "message", "meta", "name", "order", "value" FROM "InstanceCustomStatus";
67
- DROP TABLE "InstanceCustomStatus";
68
- ALTER TABLE "new_InstanceCustomStatus" RENAME TO "InstanceCustomStatus";
69
- CREATE TABLE "new_InstanceEvaluationState" (
70
- "instanceId" TEXT NOT NULL PRIMARY KEY,
71
- "status" TEXT NOT NULL,
72
- "message" TEXT,
73
- "model" JSONB,
74
- "startedAt" DATETIME NOT NULL,
75
- "finisthedAt" DATETIME,
76
- CONSTRAINT "InstanceEvaluationState_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
77
- );
78
- INSERT INTO "new_InstanceEvaluationState" ("instanceId", "message", "model", "status") SELECT "instanceId", "message", "model", "status" FROM "InstanceEvaluationState";
79
- DROP TABLE "InstanceEvaluationState";
80
- ALTER TABLE "new_InstanceEvaluationState" RENAME TO "InstanceEvaluationState";
81
- CREATE TABLE "new_InstanceLock" (
82
- "instanceId" TEXT NOT NULL PRIMARY KEY,
83
- "meta" JSONB NOT NULL,
84
- "spec" JSONB NOT NULL,
85
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
86
- CONSTRAINT "InstanceLock_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
87
- );
88
- INSERT INTO "new_InstanceLock" ("instanceId", "meta", "spec") SELECT "instanceId", "meta", "spec" FROM "InstanceLock";
89
- DROP TABLE "InstanceLock";
90
- ALTER TABLE "new_InstanceLock" RENAME TO "InstanceLock";
91
- CREATE TABLE "new_InstanceModel" (
92
- "id" TEXT NOT NULL PRIMARY KEY,
93
- "model" JSONB NOT NULL,
94
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
95
- "updatedAt" DATETIME NOT NULL
96
- );
97
- INSERT INTO "new_InstanceModel" ("id", "model") SELECT "id", "model" FROM "InstanceModel";
98
- DROP TABLE "InstanceModel";
99
- ALTER TABLE "new_InstanceModel" RENAME TO "InstanceModel";
100
- CREATE TABLE "new_Operation" (
101
- "id" TEXT NOT NULL PRIMARY KEY,
102
- "meta" JSONB NOT NULL,
103
- "type" TEXT NOT NULL,
104
- "status" TEXT NOT NULL DEFAULT 'pending',
105
- "options" JSONB NOT NULL,
106
- "requestedInstanceIds" JSONB NOT NULL,
107
- "startedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
108
- "updatedAt" DATETIME NOT NULL,
109
- "finishedAt" DATETIME
110
- );
111
- INSERT INTO "new_Operation" ("id", "meta", "options", "requestedInstanceIds", "startedAt", "type") SELECT "id", "meta", "options", "requestedInstanceIds", "startedAt", "type" FROM "Operation";
112
- DROP TABLE "Operation";
113
- ALTER TABLE "new_Operation" RENAME TO "Operation";
114
- CREATE TABLE "new_Page" (
115
- "id" TEXT NOT NULL PRIMARY KEY,
116
- "meta" JSONB NOT NULL,
117
- "instanceId" TEXT,
118
- "name" TEXT,
119
- "serviceAccountId" TEXT,
120
- "content" JSONB NOT NULL,
121
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
122
- "updatedAt" DATETIME NOT NULL,
123
- CONSTRAINT "Page_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
124
- CONSTRAINT "Page_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE SET NULL ON UPDATE CASCADE
125
- );
126
- INSERT INTO "new_Page" ("content", "id", "instanceId", "meta", "name", "serviceAccountId") SELECT "content", "id", "instanceId", "meta", "name", "serviceAccountId" FROM "Page";
127
- DROP TABLE "Page";
128
- ALTER TABLE "new_Page" RENAME TO "Page";
129
- CREATE UNIQUE INDEX "Page_instanceId_name_key" ON "Page"("instanceId", "name");
130
- CREATE TABLE "new_Secret" (
131
- "id" TEXT NOT NULL PRIMARY KEY,
132
- "meta" JSONB NOT NULL,
133
- "instanceId" TEXT,
134
- "name" TEXT,
135
- "systemName" TEXT,
136
- "serviceAccountId" TEXT,
137
- "content" JSONB NOT NULL,
138
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
139
- "updatedAt" DATETIME NOT NULL,
140
- CONSTRAINT "Secret_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
141
- CONSTRAINT "Secret_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE SET NULL ON UPDATE CASCADE
142
- );
143
- INSERT INTO "new_Secret" ("content", "id", "instanceId", "meta", "name", "serviceAccountId", "systemName") SELECT "content", "id", "instanceId", "meta", "name", "serviceAccountId", "systemName" FROM "Secret";
144
- DROP TABLE "Secret";
145
- ALTER TABLE "new_Secret" RENAME TO "Secret";
146
- CREATE UNIQUE INDEX "Secret_systemName_key" ON "Secret"("systemName");
147
- CREATE UNIQUE INDEX "Secret_instanceId_name_key" ON "Secret"("instanceId", "name");
148
- CREATE TABLE "new_ServiceAccount" (
149
- "id" TEXT NOT NULL PRIMARY KEY,
150
- "meta" JSONB NOT NULL,
151
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
152
- "updatedAt" DATETIME NOT NULL
153
- );
154
- INSERT INTO "new_ServiceAccount" ("id", "meta") SELECT "id", "meta" FROM "ServiceAccount";
155
- DROP TABLE "ServiceAccount";
156
- ALTER TABLE "new_ServiceAccount" RENAME TO "ServiceAccount";
157
- CREATE TABLE "new_Terminal" (
158
- "id" TEXT NOT NULL PRIMARY KEY,
159
- "meta" JSONB NOT NULL,
160
- "spec" JSONB NOT NULL,
161
- "instanceId" TEXT,
162
- "name" TEXT,
163
- "serviceAccountId" TEXT,
164
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
165
- "updatedAt" DATETIME NOT NULL,
166
- CONSTRAINT "Terminal_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
167
- CONSTRAINT "Terminal_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE CASCADE ON UPDATE CASCADE
168
- );
169
- INSERT INTO "new_Terminal" ("id", "instanceId", "meta", "name", "serviceAccountId", "spec") SELECT "id", "instanceId", "meta", "name", "serviceAccountId", "spec" FROM "Terminal";
170
- DROP TABLE "Terminal";
171
- ALTER TABLE "new_Terminal" RENAME TO "Terminal";
172
- CREATE UNIQUE INDEX "Terminal_instanceId_name_key" ON "Terminal"("instanceId", "name");
173
- CREATE TABLE "new_Trigger" (
174
- "id" TEXT NOT NULL PRIMARY KEY,
175
- "meta" JSONB NOT NULL,
176
- "instanceId" TEXT NOT NULL,
177
- "name" TEXT NOT NULL,
178
- "spec" JSONB NOT NULL,
179
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
180
- "updatedAt" DATETIME NOT NULL,
181
- CONSTRAINT "Trigger_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
182
- );
183
- INSERT INTO "new_Trigger" ("id", "instanceId", "meta", "name", "spec") SELECT "id", "instanceId", "meta", "name", "spec" FROM "Trigger";
184
- DROP TABLE "Trigger";
185
- ALTER TABLE "new_Trigger" RENAME TO "Trigger";
186
- CREATE UNIQUE INDEX "Trigger_instanceId_name_key" ON "Trigger"("instanceId", "name");
187
- CREATE TABLE "new_UnlockMethod" (
188
- "id" TEXT NOT NULL PRIMARY KEY,
189
- "meta" JSONB NOT NULL,
190
- "type" TEXT NOT NULL,
191
- "encryptedIdentity" TEXT NOT NULL,
192
- "recipient" TEXT NOT NULL,
193
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
194
- "updatedAt" DATETIME NOT NULL
195
- );
196
- INSERT INTO "new_UnlockMethod" ("encryptedIdentity", "id", "meta", "recipient", "type") SELECT "encryptedIdentity", "id", "meta", "recipient", "type" FROM "UnlockMethod";
197
- DROP TABLE "UnlockMethod";
198
- ALTER TABLE "new_UnlockMethod" RENAME TO "UnlockMethod";
199
- CREATE TABLE "new_WorkerVersion" (
200
- "id" TEXT NOT NULL PRIMARY KEY,
201
- "meta" JSONB NOT NULL,
202
- "workerId" TEXT NOT NULL,
203
- "digest" TEXT NOT NULL,
204
- "apiKeyId" TEXT NOT NULL,
205
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
206
- "updatedAt" DATETIME NOT NULL,
207
- CONSTRAINT "WorkerVersion_workerId_fkey" FOREIGN KEY ("workerId") REFERENCES "Worker" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
208
- CONSTRAINT "WorkerVersion_apiKeyId_fkey" FOREIGN KEY ("apiKeyId") REFERENCES "ApiKey" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
209
- );
210
- INSERT INTO "new_WorkerVersion" ("apiKeyId", "createdAt", "digest", "id", "workerId") SELECT "apiKeyId", "createdAt", "digest", "id", "workerId" FROM "WorkerVersion";
211
- DROP TABLE "WorkerVersion";
212
- ALTER TABLE "new_WorkerVersion" RENAME TO "WorkerVersion";
213
- CREATE UNIQUE INDEX "WorkerVersion_digest_key" ON "WorkerVersion"("digest");
214
- CREATE UNIQUE INDEX "WorkerVersion_apiKeyId_key" ON "WorkerVersion"("apiKeyId");
215
- PRAGMA foreign_keys=ON;
216
- PRAGMA defer_foreign_keys=OFF;
@@ -1,22 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `spec` on the `InstanceLock` table. All the data in the column will be lost.
5
- - Added the required column `token` to the `InstanceLock` table without a default value. This is not possible if the table is not empty.
6
-
7
- */
8
- -- RedefineTables
9
- PRAGMA defer_foreign_keys=ON;
10
- PRAGMA foreign_keys=OFF;
11
- CREATE TABLE "new_InstanceLock" (
12
- "instanceId" TEXT NOT NULL PRIMARY KEY,
13
- "meta" JSONB NOT NULL,
14
- "token" TEXT NOT NULL,
15
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
16
- CONSTRAINT "InstanceLock_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
17
- );
18
- INSERT INTO "new_InstanceLock" ("createdAt", "instanceId", "meta") SELECT "createdAt", "instanceId", "meta" FROM "InstanceLock";
19
- DROP TABLE "InstanceLock";
20
- ALTER TABLE "new_InstanceLock" RENAME TO "InstanceLock";
21
- PRAGMA foreign_keys=ON;
22
- PRAGMA defer_foreign_keys=OFF;
@@ -1,66 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `parentId` on the `InstanceOperationState` table. All the data in the column will be lost.
5
-
6
- */
7
- -- RedefineTables
8
- PRAGMA defer_foreign_keys=ON;
9
- PRAGMA foreign_keys=OFF;
10
- CREATE TABLE "new_InstanceOperationState" (
11
- "operationId" TEXT NOT NULL,
12
- "instanceId" TEXT NOT NULL,
13
- "status" TEXT NOT NULL,
14
- "message" TEXT,
15
- "currentResourceCount" INTEGER,
16
- "totalResourceCount" INTEGER,
17
- "args" JSONB NOT NULL,
18
- "resolvedInputs" JSONB NOT NULL,
19
- "startedAt" DATETIME,
20
- "finishedAt" DATETIME,
21
-
22
- PRIMARY KEY ("operationId", "instanceId"),
23
- CONSTRAINT "InstanceOperationState_operationId_fkey" FOREIGN KEY ("operationId") REFERENCES "Operation" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
24
- CONSTRAINT "InstanceOperationState_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
25
- );
26
- INSERT INTO "new_InstanceOperationState" ("args", "currentResourceCount", "finishedAt", "instanceId", "message", "operationId", "resolvedInputs", "startedAt", "status", "totalResourceCount") SELECT "args", "currentResourceCount", "finishedAt", "instanceId", "message", "operationId", "resolvedInputs", "startedAt", "status", "totalResourceCount" FROM "InstanceOperationState";
27
- DROP TABLE "InstanceOperationState";
28
- ALTER TABLE "new_InstanceOperationState" RENAME TO "InstanceOperationState";
29
- CREATE TABLE "new_InstanceState" (
30
- "id" TEXT NOT NULL PRIMARY KEY,
31
- "status" TEXT NOT NULL,
32
- "kind" TEXT NOT NULL,
33
- "parentId" TEXT,
34
- "inputHashNonce" INTEGER,
35
- "lastOperationId" TEXT,
36
- "statusFields" JSONB,
37
- "inputHash" INTEGER,
38
- "outputHash" INTEGER,
39
- "dependencyOutputHash" INTEGER,
40
- CONSTRAINT "InstanceState_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
41
- CONSTRAINT "InstanceState_lastOperationId_fkey" FOREIGN KEY ("lastOperationId") REFERENCES "Operation" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
42
- CONSTRAINT "InstanceState_id_lastOperationId_fkey" FOREIGN KEY ("id", "lastOperationId") REFERENCES "InstanceOperationState" ("instanceId", "operationId") ON DELETE RESTRICT ON UPDATE CASCADE
43
- );
44
- INSERT INTO "new_InstanceState" ("dependencyOutputHash", "id", "inputHash", "inputHashNonce", "kind", "lastOperationId", "outputHash", "status", "statusFields") SELECT "dependencyOutputHash", "id", "inputHash", "inputHashNonce", "kind", "lastOperationId", "outputHash", "status", "statusFields" FROM "InstanceState";
45
- DROP TABLE "InstanceState";
46
- ALTER TABLE "new_InstanceState" RENAME TO "InstanceState";
47
- CREATE UNIQUE INDEX "InstanceState_id_lastOperationId_key" ON "InstanceState"("id", "lastOperationId");
48
- CREATE TABLE "new_Terminal" (
49
- "id" TEXT NOT NULL PRIMARY KEY,
50
- "meta" JSONB NOT NULL,
51
- "status" TEXT NOT NULL DEFAULT 'active',
52
- "spec" JSONB NOT NULL,
53
- "instanceId" TEXT,
54
- "name" TEXT,
55
- "serviceAccountId" TEXT,
56
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
57
- "updatedAt" DATETIME NOT NULL,
58
- CONSTRAINT "Terminal_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
59
- CONSTRAINT "Terminal_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE CASCADE ON UPDATE CASCADE
60
- );
61
- INSERT INTO "new_Terminal" ("createdAt", "id", "instanceId", "meta", "name", "serviceAccountId", "spec", "updatedAt") SELECT "createdAt", "id", "instanceId", "meta", "name", "serviceAccountId", "spec", "updatedAt" FROM "Terminal";
62
- DROP TABLE "Terminal";
63
- ALTER TABLE "new_Terminal" RENAME TO "Terminal";
64
- CREATE UNIQUE INDEX "Terminal_instanceId_name_key" ON "Terminal"("instanceId", "name");
65
- PRAGMA foreign_keys=ON;
66
- PRAGMA defer_foreign_keys=OFF;
@@ -1,31 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `args` on the `InstanceOperationState` table. All the data in the column will be lost.
5
- - Added the required column `model` to the `InstanceOperationState` table without a default value. This is not possible if the table is not empty.
6
-
7
- */
8
- -- RedefineTables
9
- PRAGMA defer_foreign_keys=ON;
10
- PRAGMA foreign_keys=OFF;
11
- CREATE TABLE "new_InstanceOperationState" (
12
- "operationId" TEXT NOT NULL,
13
- "instanceId" TEXT NOT NULL,
14
- "status" TEXT NOT NULL,
15
- "message" TEXT,
16
- "currentResourceCount" INTEGER,
17
- "totalResourceCount" INTEGER,
18
- "model" JSONB NOT NULL,
19
- "resolvedInputs" JSONB NOT NULL,
20
- "startedAt" DATETIME,
21
- "finishedAt" DATETIME,
22
-
23
- PRIMARY KEY ("operationId", "instanceId"),
24
- CONSTRAINT "InstanceOperationState_operationId_fkey" FOREIGN KEY ("operationId") REFERENCES "Operation" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
25
- CONSTRAINT "InstanceOperationState_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
26
- );
27
- INSERT INTO "new_InstanceOperationState" ("currentResourceCount", "finishedAt", "instanceId", "message", "operationId", "resolvedInputs", "startedAt", "status", "totalResourceCount") SELECT "currentResourceCount", "finishedAt", "instanceId", "message", "operationId", "resolvedInputs", "startedAt", "status", "totalResourceCount" FROM "InstanceOperationState";
28
- DROP TABLE "InstanceOperationState";
29
- ALTER TABLE "new_InstanceOperationState" RENAME TO "InstanceOperationState";
30
- PRAGMA foreign_keys=ON;
31
- PRAGMA defer_foreign_keys=OFF;
@@ -1,24 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `finisthedAt` on the `InstanceEvaluationState` table. All the data in the column will be lost.
5
- - You are about to drop the column `startedAt` on the `InstanceEvaluationState` table. All the data in the column will be lost.
6
- - Added the required column `evaluatedAt` to the `InstanceEvaluationState` table without a default value. This is not possible if the table is not empty.
7
-
8
- */
9
- -- RedefineTables
10
- PRAGMA defer_foreign_keys=ON;
11
- PRAGMA foreign_keys=OFF;
12
- CREATE TABLE "new_InstanceEvaluationState" (
13
- "instanceId" TEXT NOT NULL PRIMARY KEY,
14
- "status" TEXT NOT NULL,
15
- "message" TEXT,
16
- "model" JSONB,
17
- "evaluatedAt" DATETIME NOT NULL,
18
- CONSTRAINT "InstanceEvaluationState_instanceId_fkey" FOREIGN KEY ("instanceId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
19
- );
20
- INSERT INTO "new_InstanceEvaluationState" ("instanceId", "message", "model", "status") SELECT "instanceId", "message", "model", "status" FROM "InstanceEvaluationState";
21
- DROP TABLE "InstanceEvaluationState";
22
- ALTER TABLE "new_InstanceEvaluationState" RENAME TO "InstanceEvaluationState";
23
- PRAGMA foreign_keys=ON;
24
- PRAGMA defer_foreign_keys=OFF;
@@ -1,2 +0,0 @@
1
- -- AlterTable
2
- ALTER TABLE "InstanceState" ADD COLUMN "exportedArtifactIds" JSONB;
@@ -1,2 +0,0 @@
1
- -- AlterTable
2
- ALTER TABLE "Operation" ADD COLUMN "phases" JSONB;
@@ -1,219 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - The primary key for the `InstanceCustomStatus` table will be changed. If it partially fails, the table could be left without primary key constraint.
5
- - You are about to drop the column `instanceId` on the `InstanceCustomStatus` table. All the data in the column will be lost.
6
- - The primary key for the `InstanceEvaluationState` table will be changed. If it partially fails, the table could be left without primary key constraint.
7
- - You are about to drop the column `instanceId` on the `InstanceEvaluationState` table. All the data in the column will be lost.
8
- - The primary key for the `InstanceLock` table will be changed. If it partially fails, the table could be left without primary key constraint.
9
- - You are about to drop the column `instanceId` on the `InstanceLock` table. All the data in the column will be lost.
10
- - The primary key for the `InstanceOperationState` table will be changed. If it partially fails, the table could be left without primary key constraint.
11
- - You are about to drop the column `instanceId` on the `InstanceOperationState` table. All the data in the column will be lost.
12
- - You are about to drop the column `lastOperationId` on the `InstanceState` table. All the data in the column will be lost.
13
- - You are about to drop the column `instanceId` on the `OperationLog` table. All the data in the column will be lost.
14
- - You are about to drop the column `instanceId` on the `Page` table. All the data in the column will be lost.
15
- - You are about to drop the column `instanceId` on the `Secret` table. All the data in the column will be lost.
16
- - You are about to drop the column `instanceId` on the `Terminal` table. All the data in the column will be lost.
17
- - You are about to drop the column `instanceId` on the `Trigger` table. All the data in the column will be lost.
18
- - The primary key for the `UserCompositeViewport` table will be changed. If it partially fails, the table could be left without primary key constraint.
19
- - You are about to drop the column `instanceId` on the `UserCompositeViewport` table. All the data in the column will be lost.
20
- - The primary key for the `WorkerUnitRegistration` table will be changed. If it partially fails, the table could be left without primary key constraint.
21
- - You are about to drop the column `instanceId` on the `WorkerUnitRegistration` table. All the data in the column will be lost.
22
- - Added the required column `stateId` to the `InstanceCustomStatus` table without a default value. This is not possible if the table is not empty.
23
- - Added the required column `stateId` to the `InstanceEvaluationState` table without a default value. This is not possible if the table is not empty.
24
- - Added the required column `stateId` to the `InstanceLock` table without a default value. This is not possible if the table is not empty.
25
- - Added the required column `stateId` to the `InstanceOperationState` table without a default value. This is not possible if the table is not empty.
26
- - Added the required column `instanceId` to the `InstanceState` table without a default value. This is not possible if the table is not empty.
27
- - Added the required column `source` to the `InstanceState` table without a default value. This is not possible if the table is not empty.
28
- - Added the required column `stateId` to the `Trigger` table without a default value. This is not possible if the table is not empty.
29
- - Added the required column `stateId` to the `UserCompositeViewport` table without a default value. This is not possible if the table is not empty.
30
- - Added the required column `stateId` to the `WorkerUnitRegistration` table without a default value. This is not possible if the table is not empty.
31
-
32
- */
33
- -- RedefineTables
34
- PRAGMA defer_foreign_keys=ON;
35
- PRAGMA foreign_keys=OFF;
36
- CREATE TABLE "new_InstanceCustomStatus" (
37
- "stateId" TEXT NOT NULL,
38
- "serviceAccountId" TEXT NOT NULL,
39
- "name" TEXT NOT NULL,
40
- "meta" JSONB NOT NULL,
41
- "value" TEXT NOT NULL,
42
- "message" TEXT,
43
- "order" INTEGER NOT NULL DEFAULT 50,
44
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
45
- "updatedAt" DATETIME NOT NULL,
46
-
47
- PRIMARY KEY ("stateId", "serviceAccountId", "name"),
48
- CONSTRAINT "InstanceCustomStatus_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
49
- CONSTRAINT "InstanceCustomStatus_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
50
- );
51
- INSERT INTO "new_InstanceCustomStatus" ("createdAt", "message", "meta", "name", "order", "serviceAccountId", "updatedAt", "value") SELECT "createdAt", "message", "meta", "name", "order", "serviceAccountId", "updatedAt", "value" FROM "InstanceCustomStatus";
52
- DROP TABLE "InstanceCustomStatus";
53
- ALTER TABLE "new_InstanceCustomStatus" RENAME TO "InstanceCustomStatus";
54
- CREATE TABLE "new_InstanceEvaluationState" (
55
- "stateId" TEXT NOT NULL PRIMARY KEY,
56
- "status" TEXT NOT NULL,
57
- "message" TEXT,
58
- "model" JSONB,
59
- "evaluatedAt" DATETIME NOT NULL,
60
- CONSTRAINT "InstanceEvaluationState_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
61
- );
62
- INSERT INTO "new_InstanceEvaluationState" ("evaluatedAt", "message", "model", "status") SELECT "evaluatedAt", "message", "model", "status" FROM "InstanceEvaluationState";
63
- DROP TABLE "InstanceEvaluationState";
64
- ALTER TABLE "new_InstanceEvaluationState" RENAME TO "InstanceEvaluationState";
65
- CREATE TABLE "new_InstanceLock" (
66
- "stateId" TEXT NOT NULL PRIMARY KEY,
67
- "meta" JSONB NOT NULL,
68
- "token" TEXT NOT NULL,
69
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
70
- CONSTRAINT "InstanceLock_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
71
- );
72
- INSERT INTO "new_InstanceLock" ("createdAt", "meta", "token") SELECT "createdAt", "meta", "token" FROM "InstanceLock";
73
- DROP TABLE "InstanceLock";
74
- ALTER TABLE "new_InstanceLock" RENAME TO "InstanceLock";
75
- CREATE TABLE "new_InstanceOperationState" (
76
- "operationId" TEXT NOT NULL,
77
- "stateId" TEXT NOT NULL,
78
- "status" TEXT NOT NULL,
79
- "message" TEXT,
80
- "currentResourceCount" INTEGER,
81
- "totalResourceCount" INTEGER,
82
- "model" JSONB NOT NULL,
83
- "resolvedInputs" JSONB NOT NULL,
84
- "startedAt" DATETIME,
85
- "finishedAt" DATETIME,
86
-
87
- PRIMARY KEY ("operationId", "stateId"),
88
- CONSTRAINT "InstanceOperationState_operationId_fkey" FOREIGN KEY ("operationId") REFERENCES "Operation" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
89
- CONSTRAINT "InstanceOperationState_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
90
- );
91
- INSERT INTO "new_InstanceOperationState" ("currentResourceCount", "finishedAt", "message", "model", "operationId", "resolvedInputs", "startedAt", "status", "totalResourceCount") SELECT "currentResourceCount", "finishedAt", "message", "model", "operationId", "resolvedInputs", "startedAt", "status", "totalResourceCount" FROM "InstanceOperationState";
92
- DROP TABLE "InstanceOperationState";
93
- ALTER TABLE "new_InstanceOperationState" RENAME TO "InstanceOperationState";
94
- CREATE TABLE "new_InstanceState" (
95
- "id" TEXT NOT NULL PRIMARY KEY,
96
- "instanceId" TEXT NOT NULL,
97
- "status" TEXT NOT NULL,
98
- "source" TEXT NOT NULL,
99
- "kind" TEXT NOT NULL,
100
- "parentId" TEXT,
101
- "inputHashNonce" INTEGER,
102
- "statusFields" JSONB,
103
- "inputHash" INTEGER,
104
- "outputHash" INTEGER,
105
- "dependencyOutputHash" INTEGER,
106
- "exportedArtifactIds" JSONB,
107
- "currentResourceCount" INTEGER,
108
- "message" TEXT,
109
- "model" JSONB,
110
- "resolvedInputs" JSONB,
111
- CONSTRAINT "InstanceState_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE
112
- );
113
- INSERT INTO "new_InstanceState" ("dependencyOutputHash", "exportedArtifactIds", "id", "inputHash", "inputHashNonce", "kind", "outputHash", "parentId", "status", "statusFields") SELECT "dependencyOutputHash", "exportedArtifactIds", "id", "inputHash", "inputHashNonce", "kind", "outputHash", "parentId", "status", "statusFields" FROM "InstanceState";
114
- DROP TABLE "InstanceState";
115
- ALTER TABLE "new_InstanceState" RENAME TO "InstanceState";
116
- CREATE UNIQUE INDEX "InstanceState_instanceId_key" ON "InstanceState"("instanceId");
117
- CREATE TABLE "new_OperationLog" (
118
- "id" TEXT NOT NULL PRIMARY KEY,
119
- "operationId" TEXT NOT NULL,
120
- "stateId" TEXT,
121
- "content" TEXT NOT NULL,
122
- CONSTRAINT "OperationLog_operationId_fkey" FOREIGN KEY ("operationId") REFERENCES "Operation" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
123
- CONSTRAINT "OperationLog_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE
124
- );
125
- INSERT INTO "new_OperationLog" ("content", "id", "operationId") SELECT "content", "id", "operationId" FROM "OperationLog";
126
- DROP TABLE "OperationLog";
127
- ALTER TABLE "new_OperationLog" RENAME TO "OperationLog";
128
- CREATE TABLE "new_Page" (
129
- "id" TEXT NOT NULL PRIMARY KEY,
130
- "meta" JSONB NOT NULL,
131
- "stateId" TEXT,
132
- "name" TEXT,
133
- "serviceAccountId" TEXT,
134
- "content" JSONB NOT NULL,
135
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
136
- "updatedAt" DATETIME NOT NULL,
137
- CONSTRAINT "Page_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
138
- CONSTRAINT "Page_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE SET NULL ON UPDATE CASCADE
139
- );
140
- INSERT INTO "new_Page" ("content", "createdAt", "id", "meta", "name", "serviceAccountId", "updatedAt") SELECT "content", "createdAt", "id", "meta", "name", "serviceAccountId", "updatedAt" FROM "Page";
141
- DROP TABLE "Page";
142
- ALTER TABLE "new_Page" RENAME TO "Page";
143
- CREATE UNIQUE INDEX "Page_stateId_name_key" ON "Page"("stateId", "name");
144
- CREATE TABLE "new_Secret" (
145
- "id" TEXT NOT NULL PRIMARY KEY,
146
- "meta" JSONB NOT NULL,
147
- "stateId" TEXT,
148
- "name" TEXT,
149
- "systemName" TEXT,
150
- "serviceAccountId" TEXT,
151
- "content" JSONB NOT NULL,
152
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
153
- "updatedAt" DATETIME NOT NULL,
154
- CONSTRAINT "Secret_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
155
- CONSTRAINT "Secret_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE SET NULL ON UPDATE CASCADE
156
- );
157
- INSERT INTO "new_Secret" ("content", "createdAt", "id", "meta", "name", "serviceAccountId", "systemName", "updatedAt") SELECT "content", "createdAt", "id", "meta", "name", "serviceAccountId", "systemName", "updatedAt" FROM "Secret";
158
- DROP TABLE "Secret";
159
- ALTER TABLE "new_Secret" RENAME TO "Secret";
160
- CREATE UNIQUE INDEX "Secret_systemName_key" ON "Secret"("systemName");
161
- CREATE UNIQUE INDEX "Secret_stateId_name_key" ON "Secret"("stateId", "name");
162
- CREATE TABLE "new_Terminal" (
163
- "id" TEXT NOT NULL PRIMARY KEY,
164
- "meta" JSONB NOT NULL,
165
- "status" TEXT NOT NULL DEFAULT 'active',
166
- "spec" JSONB NOT NULL,
167
- "stateId" TEXT,
168
- "name" TEXT,
169
- "serviceAccountId" TEXT,
170
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
171
- "updatedAt" DATETIME NOT NULL,
172
- CONSTRAINT "Terminal_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
173
- CONSTRAINT "Terminal_serviceAccountId_fkey" FOREIGN KEY ("serviceAccountId") REFERENCES "ServiceAccount" ("id") ON DELETE CASCADE ON UPDATE CASCADE
174
- );
175
- INSERT INTO "new_Terminal" ("createdAt", "id", "meta", "name", "serviceAccountId", "spec", "status", "updatedAt") SELECT "createdAt", "id", "meta", "name", "serviceAccountId", "spec", "status", "updatedAt" FROM "Terminal";
176
- DROP TABLE "Terminal";
177
- ALTER TABLE "new_Terminal" RENAME TO "Terminal";
178
- CREATE UNIQUE INDEX "Terminal_stateId_name_key" ON "Terminal"("stateId", "name");
179
- CREATE TABLE "new_Trigger" (
180
- "id" TEXT NOT NULL PRIMARY KEY,
181
- "meta" JSONB NOT NULL,
182
- "stateId" TEXT NOT NULL,
183
- "name" TEXT NOT NULL,
184
- "spec" JSONB NOT NULL,
185
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
186
- "updatedAt" DATETIME NOT NULL,
187
- CONSTRAINT "Trigger_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
188
- );
189
- INSERT INTO "new_Trigger" ("createdAt", "id", "meta", "name", "spec", "updatedAt") SELECT "createdAt", "id", "meta", "name", "spec", "updatedAt" FROM "Trigger";
190
- DROP TABLE "Trigger";
191
- ALTER TABLE "new_Trigger" RENAME TO "Trigger";
192
- CREATE UNIQUE INDEX "Trigger_stateId_name_key" ON "Trigger"("stateId", "name");
193
- CREATE TABLE "new_UserCompositeViewport" (
194
- "userId" TEXT NOT NULL,
195
- "stateId" TEXT NOT NULL,
196
- "viewport" JSONB NOT NULL,
197
-
198
- PRIMARY KEY ("userId", "stateId")
199
- );
200
- INSERT INTO "new_UserCompositeViewport" ("userId", "viewport") SELECT "userId", "viewport" FROM "UserCompositeViewport";
201
- DROP TABLE "UserCompositeViewport";
202
- ALTER TABLE "new_UserCompositeViewport" RENAME TO "UserCompositeViewport";
203
- CREATE TABLE "new_WorkerUnitRegistration" (
204
- "stateId" TEXT NOT NULL,
205
- "name" TEXT NOT NULL,
206
- "params" JSONB NOT NULL,
207
- "workerVersionId" TEXT NOT NULL,
208
- "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
209
- "updatedAt" DATETIME NOT NULL,
210
-
211
- PRIMARY KEY ("stateId", "name"),
212
- CONSTRAINT "WorkerUnitRegistration_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
213
- CONSTRAINT "WorkerUnitRegistration_workerVersionId_fkey" FOREIGN KEY ("workerVersionId") REFERENCES "WorkerVersion" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
214
- );
215
- INSERT INTO "new_WorkerUnitRegistration" ("createdAt", "name", "params", "updatedAt", "workerVersionId") SELECT "createdAt", "name", "params", "updatedAt", "workerVersionId" FROM "WorkerUnitRegistration";
216
- DROP TABLE "WorkerUnitRegistration";
217
- ALTER TABLE "new_WorkerUnitRegistration" RENAME TO "WorkerUnitRegistration";
218
- PRAGMA foreign_keys=ON;
219
- PRAGMA defer_foreign_keys=OFF;
@@ -1 +0,0 @@
1
- -- This is an empty migration.
@@ -1 +0,0 @@
1
- -- This is an empty migration.
@@ -1 +0,0 @@
1
- -- This is an empty migration.
@@ -1,16 +0,0 @@
1
- -- RedefineTables
2
- PRAGMA defer_foreign_keys=ON;
3
- PRAGMA foreign_keys=OFF;
4
- CREATE TABLE "new_UserCompositeViewport" (
5
- "userId" TEXT NOT NULL,
6
- "stateId" TEXT NOT NULL,
7
- "viewport" JSONB NOT NULL,
8
-
9
- PRIMARY KEY ("userId", "stateId"),
10
- CONSTRAINT "UserCompositeViewport_stateId_fkey" FOREIGN KEY ("stateId") REFERENCES "InstanceState" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
11
- );
12
- INSERT INTO "new_UserCompositeViewport" ("stateId", "userId", "viewport") SELECT "stateId", "userId", "viewport" FROM "UserCompositeViewport";
13
- DROP TABLE "UserCompositeViewport";
14
- ALTER TABLE "new_UserCompositeViewport" RENAME TO "UserCompositeViewport";
15
- PRAGMA foreign_keys=ON;
16
- PRAGMA defer_foreign_keys=OFF;