Set up Drizzle with Existing Database with Multiple PostgreSQL Schemas #3527
Unanswered
VicSmithVercel
asked this question in
Q&A
Replies: 1 comment
-
You can use the import { serial, text, pgTable, pgSchema } from "drizzle-orm/pg-core";
export const mySchema = pgSchema("my_schema");
export const colors = mySchema.enum('colors', ['red', 'green', 'blue']);
export const mySchemaUsers = mySchema.table('users', {
id: serial('id').primaryKey(),
name: text('name'),
color: colors('color').default('red'),
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do you set up drizzle schema to use multiple postgreSQL database schemas?
Is there some property we put on each table like in Prisma or do we make multiple database connections with search_path being different for each schema?
Beta Was this translation helpful? Give feedback.
All reactions