“If does not exist” for migration schemes and add a column to an existing table
Hello,
I'm new to Drizzle, and for a project with postgres and NextJS, I'd like, during a migration, to specify that schemas must not be recreated.
db/schemas.ts:
db/myschema_schema/users.ts:
I'd also like to know how to update an existing table (just to add columns, just in case).
Thanks in advance for your answers!
2 Replies
🆙
I think the better approach would instead be a way to mark a migration as already applied. You're liable to run into issues if you expect to be able to run migrations that have already been [partially] applied
You can do this now by manually modifying the migrations table, but this is probably worth a feature request. I'm actually surprised I don't see a way to do this already (or an existing feature request) given I can't see it being that uncommon to introspect and then contiuing to manage the schema with drizzle-kit