Issue running migrations to DB

I am having an issue running migrations to Neon. I checked that everything is exporting const variables and tried add the cjs version of drizzle kit and reinstalling node modules.. but no luck fixing it

I also tried to run a migration on a new db and its still giving me the same error. not sure whats going on

v-app git:(drizzle-orm) āœ— pnpm generate

> v-app-v2@0.0.0 generate v-app
> drizzle-kit generate:pg

drizzle-kit: v0.19.2
drizzle-orm: v0.27.0

No config path provided, using default 'drizzle.config.ts'
Reading config file 'v-app/drizzle.config.ts'
36 tables
features 3 columns 0 indexes 0 fks
plans 4 columns 0 indexes 0 fks
plans_features 3 columns 0 indexes 1 fks
teams 2 columns 0 indexes 0 fks
users 9 columns 0 indexes 0 fks
...
views 11 columns 0 indexes 3 fks

6 enums
plans_enum [free, basic, pro, enterprise]
...
view_type [dynamic, static]

[āœ“] Your SQL migration file āžœ src/db/migrations/0010_material_lilandra.sql šŸš€
āžœ  v-app git:(drizzle-orm) āœ— pnpm migrate 

> v-app-v2@0.0.0 migrate 
> tsx -r dotenv/config -r tsconfig-paths/register src/db/index.ts

{
  severity_local: 'NOTICE',
  severity: 'NOTICE',
  code: '42P06',
  message: 'schema "drizzle" already exists, skipping',
  file: 'schemacmds.c',
  line: '128',
  routine: 'CreateSchemaCommand'
}
{
  severity_local: 'NOTICE',
  severity: 'NOTICE',
  code: '42P07',
  message: 'relation "__drizzle_migrations" already exists, skipping',
  file: 'parse_utilcmd.c',
  line: '209',
  routine: 'transformCreateStmt'
}

node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^
PostgresError: type "plans" already exists
Was this page helpful?