Skip to content

Commit c314c8d

Browse files
Merge pull request #5034 from drizzle-team/kit-checks
[Drizzle Kit]: Fix postgresql introspect
2 parents ad4ddd4 + 64f4c79 commit c314c8d

File tree

7 files changed

+37
-44
lines changed

7 files changed

+37
-44
lines changed

.github/workflows/release-feature-branch.yaml

Lines changed: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -329,37 +329,25 @@ jobs:
329329
permissions:
330330
contents: read
331331
id-token: write
332+
# force empty so npm can use OIDC
333+
env:
334+
NODE_AUTH_TOKEN: ""
335+
NPM_TOKEN: ""
332336
steps:
333-
- uses: actions/checkout@v4
334-
335-
- uses: actions/setup-node@v4
336-
with:
337-
node-version: '22'
338-
registry-url: 'https://registry.npmjs.org'
339-
340-
- uses: pnpm/action-setup@v3
341-
name: Install pnpm
342-
id: pnpm-install
343-
with:
344-
version: latest
345-
run_install: false
346-
347-
- name: Get pnpm store directory
348-
id: pnpm-cache
349-
shell: bash
350-
run: |
351-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
352-
353-
- uses: actions/cache@v4
354-
name: Setup pnpm cache
355-
with:
356-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
357-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
358-
restore-keys: |
359-
${{ runner.os }}-pnpm-store-
360-
361-
- name: Install dependencies
362-
run: pnpm install
337+
- uses: actions/checkout@v5
338+
- uses: pnpm/action-setup@v4
339+
with: { run_install: false }
340+
- uses: actions/setup-node@v6
341+
with: { node-version: '24', cache: 'pnpm', cache-dependency-path: pnpm-lock.yaml }
342+
- run: pnpm install --frozen-lockfile --prefer-offline
343+
344+
# nuke, so npm can use OIDC
345+
- name: Remove temp npmrc
346+
run: rm -f "$NPM_CONFIG_USERCONFIG"
347+
348+
# >= 11.5.1 for trusted publishing
349+
- name: Update NPM
350+
run: npm install -g npm@latest
363351

364352
- name: Check preconditions
365353
id: checks
@@ -374,7 +362,6 @@ jobs:
374362
375363
if [[ "$is_version_published" == "true" ]]; then
376364
echo "\`${{ matrix.package }}$version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
377-
npm dist-tag add ${{ matrix.package }}@$version $tag
378365
else
379366
{
380367
echo "version=$version"
@@ -395,10 +382,11 @@ jobs:
395382
if: steps.checks.outputs.has_new_release == 'true'
396383
working-directory: ${{ matrix.package }}
397384
shell: bash
398-
env:
399-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
400385
run: npm run pack
401386

387+
# nuke, so npm can use OIDC
388+
- name: Remove temp npmrc
389+
run: rm -f "$NPM_CONFIG_USERCONFIG"
402390
- name: Publish
403391
if: github.event_name == 'push' && steps.checks.outputs.has_new_release == 'true'
404392
run: |
@@ -413,6 +401,4 @@ jobs:
413401
# Post release message to Discord
414402
# curl -X POST -H "Content-Type: application/json" -d "{\"embeds\": [{\"title\": \"New \`${{ matrix.package }}\` release! 🎉\", \"url\": \"https://www.npmjs.com/package/${{ matrix.package }}/v/$version\", \"color\": \"12907856\", \"fields\": [{\"name\": \"Version\", \"value\": \"\`$version\`\"}, {\"name\": \"Tag\", \"value\": \"\`$tag\`\"}]}]}" ${{ secrets.DISCORD_DEV_RELEASE_WEBHOOK_URL }}
415403
working-directory: ${{ matrix.package }}
416-
shell: bash
417-
env:
418-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
404+
shell: bash

.github/workflows/release-latest.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,16 +432,19 @@ jobs:
432432
if: steps.checks.outputs.has_new_release == 'true'
433433
working-directory: ${{ matrix.package }}
434434
shell: bash
435-
env:
436-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
437435
run: npm run pack
438-
436+
437+
# nuke, so npm can use OIDC
438+
- name: Remove temp npmrc
439+
run: rm -f "$NPM_CONFIG_USERCONFIG"
439440
- name: Publish
440441
if: steps.checks.outputs.has_new_release == 'true'
441442
working-directory: ${{ matrix.package }}
442443
shell: bash
444+
# force empty so npm can use OIDC
443445
env:
444-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
446+
NODE_AUTH_TOKEN: ""
447+
NPM_TOKEN: ""
445448
run: |
446449
version="${{ steps.checks.outputs.version }}"
447450

changelogs/drizzle-kit/0.31.7.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Bug fixes
2+
3+
- [[BUG]: Drizzle Kit push to Postgres 18 produces unecessary DROP SQL when the schema was NOT changed](https://github.com/drizzle-team/drizzle-orm/issues/4944)

drizzle-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "drizzle-kit",
3-
"version": "0.31.6",
3+
"version": "0.31.7",
44
"homepage": "https://orm.drizzle.team",
55
"keywords": [
66
"drizzle",

drizzle-kit/src/serializer/pgSerializer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,8 @@ WHERE
12571257
WHERE
12581258
tc.table_name = '${tableName}'
12591259
AND tc.constraint_schema = '${tableSchema}'
1260-
AND tc.constraint_type = 'CHECK';`);
1260+
AND tc.constraint_type = 'CHECK'
1261+
AND con.contype = 'c';`);
12611262

12621263
columnsCount += tableResponse.length;
12631264
if (progressCallback) {

drizzle-kit/tests/introspect/gel.ext.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let container: Docker.Container | undefined;
2525
async function createDockerDB(): Promise<{ connectionString: string; container: Docker.Container }> {
2626
const docker = new Docker();
2727
const port = await getPort({ port: 5656 });
28-
const image = 'geldata/gel:latest';
28+
const image = 'geldata/gel:6';
2929

3030
const pullStream = await docker.pull(image);
3131
await new Promise((resolve, reject) =>

integration-tests/tests/gel/createInstance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'zx/globals';
66
export async function createDockerDB(): Promise<{ connectionString: string; container: Docker.Container }> {
77
const docker = new Docker();
88
const port = await getPort({ port: 5656 });
9-
const image = 'geldata/gel:latest';
9+
const image = 'geldata/gel:6';
1010

1111
const pullStream = await docker.pull(image);
1212
await new Promise((resolve, reject) =>

0 commit comments

Comments
 (0)