History

Drop the definition.name narrowing from the artifact migration (#1500)

Rhys Sullivan committed 3 months ago

Commit 5eb2ca31 parent 1178e3b7 files · +15 −6Browse files

Unified · Split

7 files
  1. .changeset/lucky-hats-attack.md +5 −0
  2. apps/cloud/drizzle/0013_curly_rocket_racer.sql +0 −1
  3. apps/cloud/drizzle/meta/0013_snapshot.json +1 −1
  4. apps/cloud/drizzle/meta/0014_snapshot.json +1 −1
  5. apps/cloud/drizzle/meta/0015_snapshot.json +1 −1
  6. apps/cloud/src/db/executor-schema.ts +1 −1
  7. packages/core/sdk/src/core-schema.ts +6 −1
.changeset/lucky-hats-attack.md+5−0
@@ -0,0 +1,5 @@
1+---
2+"executor": patch
3+---
4+
5+**Fix: the artifact migration no longer narrows `definition.name` to varchar(255), which failed on existing long definition names**
apps/cloud/drizzle/0013_curly_rocket_racer.sql+0−1
@@ -11,5 +11,4 @@ CREATE TABLE "artifact" ( · 10 unmodified lines
1111 "subject" varchar(255) NOT NULL
1212 );
1313 --> statement-breakpoint
14−ALTER TABLE "definition" ALTER COLUMN "name" SET DATA TYPE varchar(255);--> statement-breakpoint
1514 CREATE UNIQUE INDEX "artifact_uidx" ON "artifact" USING btree ("tenant","owner","subject","id");
apps/cloud/drizzle/meta/0013_snapshot.json+1−1
@@ -515,7 +515,7 @@ · 514 unmodified lines
515515 },
516516 "name": {
517517 "name": "name",
518− "type": "varchar(255)",
518+ "type": "text",
519519 "primaryKey": false,
520520 "notNull": true
521521 },
apps/cloud/drizzle/meta/0014_snapshot.json+1−1
@@ -521,7 +521,7 @@ · 520 unmodified lines
521521 },
522522 "name": {
523523 "name": "name",
524− "type": "varchar(255)",
524+ "type": "text",
525525 "primaryKey": false,
526526 "notNull": true
527527 },
apps/cloud/drizzle/meta/0015_snapshot.json+1−1
@@ -527,7 +527,7 @@ · 526 unmodified lines
527527 },
528528 "name": {
529529 "name": "name",
530− "type": "varchar(255)",
530+ "type": "text",
531531 "primaryKey": false,
532532 "notNull": true
533533 },
apps/cloud/src/db/executor-schema.ts+1−1
@@ -181,7 +181,7 @@ export const definition = pgTable( · 180 unmodified lines
181181 integration: varchar("integration", { length: 255 }).notNull(),
182182 connection: varchar("connection", { length: 255 }).notNull(),
183183 plugin_id: text("plugin_id").notNull(),
184− name: varchar("name", { length: 255 }).notNull(),
184+ name: text("name").notNull(),
185185 schema: json("schema").notNull(),
186186 created_at: timestamp("created_at").notNull(),
187187 row_id: varchar("row_id", { length: 255 })
packages/core/sdk/src/core-schema.ts+6−1
@@ -336,7 +336,12 @@ export const coreTables = defineTables({ · 335 unmodified lines
336336 integration: keyColumn("integration"),
337337 connection: keyColumn("connection"),
338338 plugin_id: textColumn("plugin_id"),
339− name: keyColumn("name"),
339+ // text, NOT keyColumn: $def names exceed 255 chars in production (deep
340+ // OpenAPI component paths), and the live cloud column has been TEXT
341+ // since the baseline was patched for it. A varchar(255) here re-emits a
342+ // narrowing ALTER on every drizzle-kit generate, which fails on real
343+ // rows (22001) — that drift broke cloud migration 0013 once already.
344+ name: textColumn("name"),
340345 schema: jsonColumn("schema"),
341346 created_at: dateColumn("created_at"),
342347 },