From fa90b3f30ef3c42d453375341bd8a6a4e4fbc83c Mon Sep 17 00:00:00 2001 From: Oliver Bryan <04oliverbryan@gmail.com> Date: Sun, 14 Dec 2025 21:50:44 +0000 Subject: [PATCH] added assigneeId to Issue --- .../backend/drizzle/0003_steady_swordsman.sql | 2 + .../backend/drizzle/meta/0003_snapshot.json | 240 ++++++++++++++++++ packages/backend/drizzle/meta/_journal.json | 7 + packages/shared/src/schema.ts | 2 + 4 files changed, 251 insertions(+) create mode 100644 packages/backend/drizzle/0003_steady_swordsman.sql create mode 100644 packages/backend/drizzle/meta/0003_snapshot.json diff --git a/packages/backend/drizzle/0003_steady_swordsman.sql b/packages/backend/drizzle/0003_steady_swordsman.sql new file mode 100644 index 0000000..d580650 --- /dev/null +++ b/packages/backend/drizzle/0003_steady_swordsman.sql @@ -0,0 +1,2 @@ +ALTER TABLE "Issue" ADD COLUMN "assigneeId" integer;--> statement-breakpoint +ALTER TABLE "Issue" ADD CONSTRAINT "Issue_assigneeId_User_id_fk" FOREIGN KEY ("assigneeId") REFERENCES "public"."User"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file diff --git a/packages/backend/drizzle/meta/0003_snapshot.json b/packages/backend/drizzle/meta/0003_snapshot.json new file mode 100644 index 0000000..7c09250 --- /dev/null +++ b/packages/backend/drizzle/meta/0003_snapshot.json @@ -0,0 +1,240 @@ +{ + "id": "0c0fc7ad-7348-4d75-af0f-3e96bbf17dd5", + "prevId": "b57ed503-91cd-439b-888a-a7181acd1819", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.Issue": { + "name": "Issue", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "Issue_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "projectId": { + "name": "projectId", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number": { + "name": "number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": true + }, + "assigneeId": { + "name": "assigneeId", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "unique_project_issue_number": { + "name": "unique_project_issue_number", + "columns": [ + { + "expression": "projectId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "Issue_projectId_Project_id_fk": { + "name": "Issue_projectId_Project_id_fk", + "tableFrom": "Issue", + "tableTo": "Project", + "columnsFrom": [ + "projectId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "Issue_assigneeId_User_id_fk": { + "name": "Issue_assigneeId_User_id_fk", + "tableFrom": "Issue", + "tableTo": "User", + "columnsFrom": [ + "assigneeId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.Project": { + "name": "Project", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "Project_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "blob": { + "name": "blob", + "type": "varchar(4)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "ownerId": { + "name": "ownerId", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "Project_ownerId_User_id_fk": { + "name": "Project_ownerId_User_id_fk", + "tableFrom": "Project", + "tableTo": "User", + "columnsFrom": [ + "ownerId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.User": { + "name": "User", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "always", + "name": "User_id_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "name": { + "name": "name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "User_username_unique": { + "name": "User_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/backend/drizzle/meta/_journal.json b/packages/backend/drizzle/meta/_journal.json index 10513b9..7c93e9c 100644 --- a/packages/backend/drizzle/meta/_journal.json +++ b/packages/backend/drizzle/meta/_journal.json @@ -22,6 +22,13 @@ "when": 1765149910114, "tag": "0002_abnormal_fenris", "breakpoints": true + }, + { + "idx": 3, + "version": "7", + "when": 1765748942767, + "tag": "0003_steady_swordsman", + "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/shared/src/schema.ts b/packages/shared/src/schema.ts index e94e6c8..044ff6e 100644 --- a/packages/shared/src/schema.ts +++ b/packages/shared/src/schema.ts @@ -29,6 +29,8 @@ export const Issue = pgTable( title: varchar({ length: 256 }).notNull(), description: varchar({ length: 2048 }).notNull(), + + assigneeId: integer().references(() => User.id), }, (t) => [ // ensures unique numbers per project