drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[BUG]: Migrate does not throw error

Open edishu opened this issue 1 year ago • 0 comments

What version of drizzle-orm are you using?

0.30.10

What version of drizzle-kit are you using?

0.21.1

Describe the Bug

I was trying to create my first migration on a locally running Postgres instance. I had following configuration in my drizzle.config.ts

import 'dotenv/config';
import type { Config } from 'drizzle-kit';

export default {
  schema: './src/schema.ts',
  out: './drizzle',
  dialect: 'postgresql',
  dbCredentials: {
    host: '127.0.0.1',
    user: 'postgres',
    password: 'password',
    database: 'postgres',
  },
} satisfies Config;
  1. Then I generated the migration: npx drizzle-kit generate

This successfully created migration SQL file.

  1. Then I ran the migration for my locally running Postgres instance npx drizzle-kit migrate

Following output was produced:

drizzle-kit: v0.21.1
drizzle-orm: v0.30.10

No config path provided, using default path
Reading config file '/Users/udayan/playy/drizzle-test/drizzle.config.ts'
Using 'pg' driver for database querying
[✓] migrations applied successfully!%

However, I did not see any change in my database. Expected table was not created.

The bug is in my drizzle.config.ts. I forgot to mention the port of the database.

Expected behavior

When there is a bug in drizzle.config.ts file. drizzle-kit migrate command should throw error instead of showing

[✓] migrations applied successfully!

Environment & setup

Node v18.17.1 npm v9.6.7 macOS Sonoma 14.4.1

edishu avatar May 13 '24 16:05 edishu