© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
1 reply
kanopo

Generate column from another column postgresql

CREATE TABLE IF NOT EXISTS "Organizations" (
  "id" SERIAL,
  "name" VARCHAR(255),
  "lowercaseName" VARCHAR(255) GENERATED ALWAYS AS (LOWER("name")) STORED,
  
  PRIMARY KEY("id"),
  UNIQUE("lowercaseName")
);
CREATE TABLE IF NOT EXISTS "Organizations" (
  "id" SERIAL,
  "name" VARCHAR(255),
  "lowercaseName" VARCHAR(255) GENERATED ALWAYS AS (LOWER("name")) STORED,
  
  PRIMARY KEY("id"),
  UNIQUE("lowercaseName")
);


Hi guys, I've been watching the docs and the discord server for quite some time and I haven't been able to find instructions about this use case using drizzle.

Thank you
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

Keyboard input not working when `table created or renamed from another column?`
Drizzle TeamDTDrizzle Team / help
2y ago
Generate drizzle model from database
Drizzle TeamDTDrizzle Team / help
17mo ago
How to set a default value for column based on another column?
Drizzle TeamDTDrizzle Team / help
3y ago
how to generate type from schema
Drizzle TeamDTDrizzle Team / help
2y ago