Postgres Schema (namespace)

Does anyone have a minimal example of a Drizzle postgres schema that uses the Postgres "Schema" (namespace) feature?

On drizzle kit push I keep getting error: schema "meow" does not exist.

import { sql } from "drizzle-orm"
import {
  index,
  serial,
  timestamp,
  pgSchema,
  text,
} from "drizzle-orm/pg-core"

const schema = pgSchema("meow")

const time = (name="time") => timestamp(name, { withTimezone: true, mode: "date" }).default(sql`CURRENT_TIMESTAMP`).notNull()
const event = schema.enum("event_type", ["click", "buy", "poll"])

export const User = schema.table("user", {
  id:       text("id").primaryKey(),
  email:    text("email").unique().notNull(),
  hash:     text("hash").notNull(),
  username: text("username").unique().notNull(),
})
Was this page helpful?