© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
7 replies
meow

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
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(),
})
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(),
})
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

Postgres Schema (namespace) + Drizzle
Drizzle TeamDTDrizzle Team / help
2y ago
postgres schema indexes INCLUDE
Drizzle TeamDTDrizzle Team / help
2y ago
Mysterious Postgres Schema Issue
Drizzle TeamDTDrizzle Team / help
2y ago
Programmatically pull table schema (Postgres)
Drizzle TeamDTDrizzle Team / help
2mo ago