© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•16mo ago•
3 replies
Virdrox

“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:
import { pgSchema } from "drizzle-orm/pg-core";

export const myschema = pgSchema("schema_name");
import { pgSchema } from "drizzle-orm/pg-core";

export const myschema = pgSchema("schema_name");


db/myschema_schema/users.ts:
import { myschema } from "@/db/schemas/schemas";

export const users = myschema.table("users", {
import { myschema } from "@/db/schemas/schemas";

export const users = myschema.table("users", {


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!
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to add a new column to an existing table
Drizzle TeamDTDrizzle Team / help
2y ago
`ADD COLUMN` and `RENAME COLUMN` migration issues
Drizzle TeamDTDrizzle Team / help
2y ago
posible to add a serial column in a existing table? (PGtable)
Drizzle TeamDTDrizzle Team / help
10mo ago
Constraint does not exist when running migration
Drizzle TeamDTDrizzle Team / help
13mo ago