© 2026 Hedgehog Software, LLC

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

Column primary key not working

What am I doing wrong when defining my primary key here?
column:
const customPrimaryKey = customType<{
  data: number;
  notNull: true;
  default: true;
}>({
  dataType() {
    return `id bigint generated always as identity primary key`;
  },
});
const customPrimaryKey = customType<{
  data: number;
  notNull: true;
  default: true;
}>({
  dataType() {
    return `id bigint generated always as identity primary key`;
  },
});


Generated SQL:
CREATE TABLE IF NOT EXISTS "users" (
    "id" "bigint generated always as identity primary key",
CREATE TABLE IF NOT EXISTS "users" (
    "id" "bigint generated always as identity primary key",


Error:
error: type "bigint generated always as identity primary key" does not exist
error: type "bigint generated always as identity primary key" does not exist
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

Primary key is not applied
Drizzle TeamDTDrizzle Team / help
15mo ago
error: column "x" is in a primary key
Drizzle TeamDTDrizzle Team / help
3y ago
Compostie primary key of a composite primary key
Drizzle TeamDTDrizzle Team / help
2y ago
Composite Primary Key?
Drizzle TeamDTDrizzle Team / help
16mo ago