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
11 "subject" varchar(255) NOT NULL11 "subject" varchar(255) NOT NULL
12);12);
13--> statement-breakpoint13--> statement-breakpoint
14ALTER TABLE "definition" ALTER COLUMN "name" SET DATA TYPE varchar(255);--> statement-breakpoint
15CREATE UNIQUE INDEX "artifact_uidx" ON "artifact" USING btree ("tenant","owner","subject","id");14CREATE 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
515 },515 },
516 "name": {516 "name": {
517 "name": "name",517 "name": "name",
518 "type": "varchar(255)",518 "type": "text",
519 "primaryKey": false,519 "primaryKey": false,
520 "notNull": true520 "notNull": true
521 },521 },
apps/cloud/drizzle/meta/0014_snapshot.json+1−1
@@ -521,7 +521,7 @@ · 520 unmodified lines
521 },521 },
522 "name": {522 "name": {
523 "name": "name",523 "name": "name",
524 "type": "varchar(255)",524 "type": "text",
525 "primaryKey": false,525 "primaryKey": false,
526 "notNull": true526 "notNull": true
527 },527 },
apps/cloud/drizzle/meta/0015_snapshot.json+1−1
@@ -527,7 +527,7 @@ · 526 unmodified lines
527 },527 },
528 "name": {528 "name": {
529 "name": "name",529 "name": "name",
530 "type": "varchar(255)",530 "type": "text",
531 "primaryKey": false,531 "primaryKey": false,
532 "notNull": true532 "notNull": true
533 },533 },
apps/cloud/src/db/executor-schema.ts+1−1
@@ -181,7 +181,7 @@ export const definition = pgTable( · 180 unmodified lines
181 integration: varchar("integration", { length: 255 }).notNull(),181 integration: varchar("integration", { length: 255 }).notNull(),
182 connection: varchar("connection", { length: 255 }).notNull(),182 connection: varchar("connection", { length: 255 }).notNull(),
183 plugin_id: text("plugin_id").notNull(),183 plugin_id: text("plugin_id").notNull(),
184 name: varchar("name", { length: 255 }).notNull(),184 name: text("name").notNull(),
185 schema: json("schema").notNull(),185 schema: json("schema").notNull(),
186 created_at: timestamp("created_at").notNull(),186 created_at: timestamp("created_at").notNull(),
187 row_id: varchar("row_id", { length: 255 })187 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
336 integration: keyColumn("integration"),336 integration: keyColumn("integration"),
337 connection: keyColumn("connection"),337 connection: keyColumn("connection"),
338 plugin_id: textColumn("plugin_id"),338 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"),
340 schema: jsonColumn("schema"),345 schema: jsonColumn("schema"),
341 created_at: dateColumn("created_at"),346 created_at: dateColumn("created_at"),
342 },347 },