Open apoorv569 opened 2 months ago
Exact same bug. Have been trying to debug it since a couple days.
Same Bug
applying migrations...{ severity_local: 'NOTICE', severity: 'NOTICE', code: '42P06', message: 'schema "public" already exists, skipping', file: 'schemacmds.c', line: '135', routine: 'CreateSchemaCommand' } { severity_local: 'NOTICE', severity: 'NOTICE', code: '42P07', message: 'relation "__drizzle_migrations" already exists, skipping', file: 'parse_utilcmd.c', line: '210', routine: 'transformCreateStmt' }
Same Bug,
The issue is that when Drizzle-Kit generates a FOREIGN_KEY statement, it automatically includes the "public" schema by default. The "public" schema is added to the refrenced tableName.
I suggest adding an option to drizzle-kit to exclude the schema name from migration files.
Is there any temporary fix for now?
Can anyone provide steps to reproduce this bug? We'll take a look at this.
I encountered a similar issue today, where migrate
complained about a missing relation because it didn't know which database schema to look in.
applying migrations...PostgresError: relation "....." does not exist
Setting schemaFilter: public
in drizzle.config.ts
seems to be a valid workaround.
Doc reference for schemaFilter.
drizzle-kit@0.26.2
drizzle-orm@0.35.3
What version of
drizzle-orm
are you using?0.33.0
What version of
drizzle-kit
are you using?0.24.0
Describe the Bug
When try to run the migration I get the following error,
Expected behavior
Migration should run fine.
Environment & setup
This is an app I'm making which uses
drizzle
as theORM
.