feat: add patch table and related constraints

- Introduced a new SQL file to create a "patch" table with a custom ENUM type "patchType" for tracking changes.
- Added foreign key constraints linking "applicationId" and "composeId" to their respective tables.
- Removed the previous SQL file that contained redundant definitions for the "patchType" and its column in the "patch" table.
This commit is contained in:
Mauricio Siu
2026-02-18 14:40:48 -06:00
parent 42e8320866
commit 5faa319b69
5 changed files with 22 additions and 7471 deletions

View File

@@ -1,5 +1,7 @@
CREATE TYPE "public"."patchType" AS ENUM('create', 'update', 'delete');--> statement-breakpoint
CREATE TABLE "patch" (
"patchId" text PRIMARY KEY NOT NULL,
"type" "patchType" DEFAULT 'update' NOT NULL,
"filePath" text NOT NULL,
"enabled" boolean DEFAULT true NOT NULL,
"content" text NOT NULL,

View File

@@ -1,2 +0,0 @@
CREATE TYPE "public"."patchType" AS ENUM('create', 'update', 'delete');--> statement-breakpoint
ALTER TABLE "patch" ADD COLUMN "type" "patchType" DEFAULT 'update' NOT NULL;

View File

@@ -1,5 +1,5 @@
{
"id": "5ba7ed04-440d-49a1-a7b6-8d4f4b147fc8",
"id": "ec86a5ad-8776-483e-a003-346d32f65089",
"prevId": "50c73964-11f8-41d6-a282-780e38bdddd9",
"version": "7",
"dialect": "postgresql",
@@ -4983,6 +4983,14 @@
"primaryKey": true,
"notNull": true
},
"type": {
"name": "type",
"type": "patchType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'update'"
},
"filePath": {
"name": "filePath",
"type": "text",
@@ -7343,6 +7351,15 @@
"teams"
]
},
"public.patchType": {
"name": "patchType",
"schema": "public",
"values": [
"create",
"update",
"delete"
]
},
"public.protocolType": {
"name": "protocolType",
"schema": "public",

File diff suppressed because it is too large Load Diff

View File

@@ -1020,15 +1020,8 @@
{
"idx": 145,
"version": "7",
"when": 1771307553867,
"tag": "0145_bitter_vivisector",
"breakpoints": true
},
{
"idx": 146,
"version": "7",
"when": 1771315685460,
"tag": "0146_clammy_titanium_man",
"when": 1771447229358,
"tag": "0145_remarkable_titania",
"breakpoints": true
}
]