@friggframework/core 2.0.0--canary.517.b384239.0 → 2.0.0--canary.517.bd5ddfc.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.517.b384239.0",
4
+ "version": "2.0.0--canary.517.bd5ddfc.0",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
7
7
  "@aws-sdk/client-kms": "^3.588.0",
@@ -38,9 +38,9 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@friggframework/eslint-config": "2.0.0--canary.517.b384239.0",
42
- "@friggframework/prettier-config": "2.0.0--canary.517.b384239.0",
43
- "@friggframework/test": "2.0.0--canary.517.b384239.0",
41
+ "@friggframework/eslint-config": "2.0.0--canary.517.bd5ddfc.0",
42
+ "@friggframework/prettier-config": "2.0.0--canary.517.bd5ddfc.0",
43
+ "@friggframework/test": "2.0.0--canary.517.bd5ddfc.0",
44
44
  "@prisma/client": "^6.19.3",
45
45
  "@types/lodash": "4.17.15",
46
46
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "b384239f327baa975cb82c0f63888e67f40160c3"
83
+ "gitHead": "bd5ddfc493049d1c233bce2f2b8203d50a1f129c"
84
84
  }
@@ -0,0 +1,61 @@
1
+ -- The AdminScriptExecution and ScriptSchedule models are declared in
2
+ -- schema.prisma but were never created by any prior migration (they shipped
3
+ -- with the admin-script-runner feature, MongoDB-first). Without these tables a
4
+ -- Postgres deployment throws P2021 on the first admin-script execution
5
+ -- (createExecution) or schedule write (upsertSchedule).
6
+ --
7
+ -- Additive and non-destructive: two new tables + one new enum type. No existing
8
+ -- table or row is touched.
9
+
10
+ -- CreateEnum
11
+ CREATE TYPE "AdminScriptExecutionState" AS ENUM ('PENDING', 'RUNNING', 'COMPLETED', 'FAILED');
12
+
13
+ -- CreateTable
14
+ CREATE TABLE "AdminScriptExecution" (
15
+ "id" SERIAL NOT NULL,
16
+ "name" TEXT NOT NULL,
17
+ "type" TEXT NOT NULL,
18
+ "state" "AdminScriptExecutionState" NOT NULL DEFAULT 'PENDING',
19
+ "context" JSONB NOT NULL DEFAULT '{}',
20
+ "results" JSONB NOT NULL DEFAULT '{}',
21
+ "parentExecutionId" INTEGER,
22
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
23
+ "updatedAt" TIMESTAMP(3) NOT NULL,
24
+
25
+ CONSTRAINT "AdminScriptExecution_pkey" PRIMARY KEY ("id")
26
+ );
27
+
28
+ -- CreateTable
29
+ CREATE TABLE "ScriptSchedule" (
30
+ "id" SERIAL NOT NULL,
31
+ "scriptName" TEXT NOT NULL,
32
+ "enabled" BOOLEAN NOT NULL DEFAULT false,
33
+ "cronExpression" TEXT,
34
+ "timezone" TEXT NOT NULL DEFAULT 'UTC',
35
+ "lastTriggeredAt" TIMESTAMP(3),
36
+ "nextTriggerAt" TIMESTAMP(3),
37
+ "externalScheduleId" TEXT,
38
+ "externalScheduleName" TEXT,
39
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
40
+ "updatedAt" TIMESTAMP(3) NOT NULL,
41
+
42
+ CONSTRAINT "ScriptSchedule_pkey" PRIMARY KEY ("id")
43
+ );
44
+
45
+ -- CreateIndex
46
+ CREATE INDEX "AdminScriptExecution_name_createdAt_idx" ON "AdminScriptExecution"("name", "createdAt" DESC);
47
+
48
+ -- CreateIndex
49
+ CREATE INDEX "AdminScriptExecution_state_idx" ON "AdminScriptExecution"("state");
50
+
51
+ -- CreateIndex
52
+ CREATE INDEX "AdminScriptExecution_type_idx" ON "AdminScriptExecution"("type");
53
+
54
+ -- CreateIndex
55
+ CREATE UNIQUE INDEX "ScriptSchedule_scriptName_key" ON "ScriptSchedule"("scriptName");
56
+
57
+ -- CreateIndex
58
+ CREATE INDEX "ScriptSchedule_enabled_idx" ON "ScriptSchedule"("enabled");
59
+
60
+ -- AddForeignKey
61
+ ALTER TABLE "AdminScriptExecution" ADD CONSTRAINT "AdminScriptExecution_parentExecutionId_fkey" FOREIGN KEY ("parentExecutionId") REFERENCES "AdminScriptExecution"("id") ON DELETE SET NULL ON UPDATE CASCADE;