Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration script hangs after upgrading to postgres@3.4.4 #843

Closed
adspacheco opened this issue Apr 10, 2024 · 1 comment
Closed

Migration script hangs after upgrading to postgres@3.4.4 #843

adspacheco opened this issue Apr 10, 2024 · 1 comment

Comments

@adspacheco
Copy link

adspacheco commented Apr 10, 2024

After updating the postgres package from version 3.4.3 to 3.4.4 in my Bun project, I have encountered an issue where my migration script hangs indefinitely. The script works as expected without any problems when using version 3.4.3. However, after the upgrade, executing the migration script through Bun's CLI (bun migrate.ts) causes the terminal to freeze, and the process never completes.

Steps to Reproduce

  1. Upgrade the postgres package from 3.4.3 to 3.4.4 in a Bun project.
  2. Run the migration script using Bun's CLI command bun migrate.ts.

The migration script (migrate.ts) is as follows:

import postgres from "postgres";
import { drizzle } from "drizzle-orm/postgres-js";
import { migrate } from "drizzle-orm/postgres-js/migrator";

const connection = postgres('postgres://docker:docker@localhost:5432/db', { max: 1 });
const db = drizzle(connection);

await migrate(db, { migrationsFolder: 'drizzle' });

await connection.end();

console.log("closed connection");

process.exit();

Expected Behavior

The migration script should run to completion, applying the necessary database migrations, closing the connection, and then exiting the process, similar to how it behaves with version 3.4.3 of the postgres package.

Actual Behavior

Upon executing the migration script with postgres version 3.4.4, the terminal becomes unresponsive, and the script does not complete its execution. There is no error message and no console.log displays, and the process appears to be stuck indefinitely.
)

Additional Context

Reverting back to version 3.4.3 of the postgres package resolves the issue, suggesting that the problem is likely introduced in 3.4.4.

Thank you!

@porsager
Copy link
Owner

If it works with node, the issue is in bun 😉

You can reopen if it also doesn't work in node, but it sounds like this issue here to me. #817 (comment)

You can simply use 3.4.3 until bun fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants