Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM node:24-slim AS deps
WORKDIR /app
RUN corepack enable pnpm && corepack prepare pnpm@11 --activate
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY patches ./patches
RUN pnpm install --frozen-lockfile

FROM node:24-slim AS builder
Expand All @@ -17,7 +18,12 @@ RUN npx next build

FROM node:24-slim AS drizzle
WORKDIR /drizzle
RUN npm install drizzle-kit drizzle-orm
RUN apt-get update \
&& apt-get install -y --no-install-recommends patch \
&& rm -rf /var/lib/apt/lists/*
RUN npm install drizzle-kit@0.31.10 drizzle-orm@0.45.2
COPY patches/drizzle-kit@0.31.10.patch /tmp/drizzle-kit.patch
RUN patch --directory=node_modules/drizzle-kit --strip=1 < /tmp/drizzle-kit.patch

FROM node:24-slim AS runner
WORKDIR /app
Expand Down
5 changes: 1 addition & 4 deletions web/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,9 @@ export const serviceRevisions = pgTable(
.notNull(),
},
(table) => [
// The database constraint is physically (id, service_id), but drizzle-kit
// 0.31.10 reports it as (service_id, id) during push diffing. Keep this order
// to avoid a drop/recreate that fails because foreign keys depend on it.
unique("service_revisions_id_service_id_unique").on(
table.serviceId,
table.id,
table.serviceId,
),
index("service_revisions_service_created_id_idx").on(
table.serviceId,
Expand Down
4 changes: 2 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"clsx": "^2.1.1",
"cron-parser": "^5.4.0",
"cronstrue": "^3.9.0",
"drizzle-orm": "^0.45.1",
"drizzle-orm": "^0.45.2",
"inngest": "^4.3.0",
"input-otp": "^1.4.2",
"ip-address": "^10.1.0",
Expand Down Expand Up @@ -62,7 +62,7 @@
"@types/react": "19.2.17",
"@types/react-dom": "19.2.3",
"@types/validator": "^13.15.10",
"drizzle-kit": "^0.31.8",
"drizzle-kit": "^0.31.10",
"eslint": "^9",
"eslint-config-next": "16.2.9",
"tailwindcss": "^4",
Expand Down
78 changes: 78 additions & 0 deletions web/patches/drizzle-kit@0.31.10.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff --git a/api.js b/api.js
index f4ecb91959f62fc938416a0585458c0a710af161..538e15d24636ffff2dee2b641629a8d5ed0422f9 100644
--- a/api.js
+++ b/api.js
@@ -23174,10 +23174,16 @@ WHERE
const checkConstraints = {};
const tableResponse = await getColumnsInfoQuery({ schema: tableSchema, table: tableName, db });
const tableConstraints = await db.query(
- `SELECT c.column_name, c.data_type, constraint_type, constraint_name, constraint_schema
+ `SELECT kcu.column_name, c.data_type, tc.constraint_type, tc.constraint_name, tc.constraint_schema
FROM information_schema.table_constraints tc
- JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name)
- JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema
- AND tc.table_name = c.table_name AND ccu.column_name = c.column_name
- WHERE tc.table_name = '${tableName}' and constraint_schema = '${tableSchema}';`
+ JOIN information_schema.key_column_usage kcu
+ ON tc.constraint_name = kcu.constraint_name
+ AND tc.constraint_schema = kcu.constraint_schema
+ AND tc.table_name = kcu.table_name
+ JOIN information_schema.columns AS c
+ ON c.table_schema = tc.constraint_schema
+ AND c.table_name = tc.table_name
+ AND c.column_name = kcu.column_name
+ WHERE tc.table_name = '${tableName}' and tc.constraint_schema = '${tableSchema}'
+ ORDER BY tc.constraint_name, kcu.ordinal_position;`
);
diff --git a/api.mjs b/api.mjs
index a940272dfb05accf57a472c46c52652ec9ad0080..c6b4beb146da1777804b34768063c225224efd1e 100644
--- a/api.mjs
+++ b/api.mjs
@@ -23190,10 +23190,16 @@ WHERE
const checkConstraints = {};
const tableResponse = await getColumnsInfoQuery({ schema: tableSchema, table: tableName, db });
const tableConstraints = await db.query(
- `SELECT c.column_name, c.data_type, constraint_type, constraint_name, constraint_schema
+ `SELECT kcu.column_name, c.data_type, tc.constraint_type, tc.constraint_name, tc.constraint_schema
FROM information_schema.table_constraints tc
- JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name)
- JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema
- AND tc.table_name = c.table_name AND ccu.column_name = c.column_name
- WHERE tc.table_name = '${tableName}' and constraint_schema = '${tableSchema}';`
+ JOIN information_schema.key_column_usage kcu
+ ON tc.constraint_name = kcu.constraint_name
+ AND tc.constraint_schema = kcu.constraint_schema
+ AND tc.table_name = kcu.table_name
+ JOIN information_schema.columns AS c
+ ON c.table_schema = tc.constraint_schema
+ AND c.table_name = tc.table_name
+ AND c.column_name = kcu.column_name
+ WHERE tc.table_name = '${tableName}' and tc.constraint_schema = '${tableSchema}'
+ ORDER BY tc.constraint_name, kcu.ordinal_position;`
);
diff --git a/bin.cjs b/bin.cjs
index 07274ea6f53fd54a129b3d338892feda6e995cff..d26825fc18ebe1859260828b6a4efa6e4f95e78c 100755
--- a/bin.cjs
+++ b/bin.cjs
@@ -17732,10 +17732,16 @@ WHERE
const checkConstraints = {};
const tableResponse = await getColumnsInfoQuery({ schema: tableSchema, table: tableName, db });
const tableConstraints = await db.query(
- `SELECT c.column_name, c.data_type, constraint_type, constraint_name, constraint_schema
+ `SELECT kcu.column_name, c.data_type, tc.constraint_type, tc.constraint_name, tc.constraint_schema
FROM information_schema.table_constraints tc
- JOIN information_schema.constraint_column_usage AS ccu USING (constraint_schema, constraint_name)
- JOIN information_schema.columns AS c ON c.table_schema = tc.constraint_schema
- AND tc.table_name = c.table_name AND ccu.column_name = c.column_name
- WHERE tc.table_name = '${tableName}' and constraint_schema = '${tableSchema}';`
+ JOIN information_schema.key_column_usage kcu
+ ON tc.constraint_name = kcu.constraint_name
+ AND tc.constraint_schema = kcu.constraint_schema
+ AND tc.table_name = kcu.table_name
+ JOIN information_schema.columns AS c
+ ON c.table_schema = tc.constraint_schema
+ AND c.table_name = tc.table_name
+ AND c.column_name = kcu.column_name
+ WHERE tc.table_name = '${tableName}' and tc.constraint_schema = '${tableSchema}'
+ ORDER BY tc.constraint_name, kcu.ordinal_position;`
);
Loading
Loading