FG
๐Ÿ’ป Software๐Ÿ—„๏ธ Databases

[BUG]: drizzle-kit generate not working without error

Fresh3 days ago
Mar 14, 20260 views
Confidence Score62%
62%

Problem

Report hasn't been filed before. - [x] I have verified that the bug I'm about to report hasn't been filed before. What version of `drizzle-orm` are you using? 1.0.0-beta.2-58a4521 What version of `drizzle-kit` are you using? 1.0.0-beta.2-58a4521 Other packages _No response_ Describe the Bug I updated from beta1 to beta2. After doing some schema changes I wanted to generate the migration files. This told me to run drizzle-kit up, which i did. [code block] Then i run generate again and it still told me to run the up command. The meta folder did not get deleted. Maybe a separate bug which was already mentioned on Discord. After deleting the meta folder manually i run generate again and then it fails without any information: [code block]

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix โ€“ Awaiting Verification

Fix drizzle-kit generate command failure after schema update

Medium Risk

The failure of the 'drizzle-kit generate' command after updating from beta1 to beta2 is likely due to residual metadata from the previous version. The command relies on a clean state to generate migration files, and the presence of outdated meta files can cause it to fail without providing specific error messages.

Awaiting Verification

Be the first to verify this fix

  1. 1

    Remove existing meta folder

    Manually delete the 'meta' folder in your project directory to ensure no outdated metadata interferes with the generation process.

    bash
    rm -rf ./meta
  2. 2

    Run drizzle-kit up command

    Execute the 'drizzle-kit up' command to apply any pending migrations and ensure the database schema is up to date.

    bash
    npx drizzle-kit up
  3. 3

    Generate migration files

    After confirming the database is up to date, run the 'drizzle-kit generate' command to create new migration files based on the current schema.

    bash
    npx drizzle-kit generate
  4. 4

    Check for errors

    Monitor the output of the 'generate' command for any error messages. If it fails again, ensure that there are no other conflicting files or configurations in your project.

  5. 5

    Verify migration files

    Check the generated migration files in the designated output directory to confirm they reflect the expected schema changes.

    bash
    ls ./migrations

Validation

Confirm that the 'drizzle-kit generate' command completes successfully without errors and that the migration files are correctly generated in the output directory.

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

drizzleormtypescriptbug1.0.0-beta.*