ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Teamโ€ข3y agoโ€ข
8 replies
tomri

error: column "id" cannot be cast automatically to type uuid

im using drizzle, and this is my schema:
export const tags = pgTable("tags", {
  id: uuid("id").defaultRandom().primaryKey(),
  tag: text("tag").notNull(),
});
export const tags = pgTable("tags", {
  id: uuid("id").defaultRandom().primaryKey(),
  tag: text("tag").notNull(),
});


when I tried pushing it:
tomri:/mnt/t/Projects/AGSCraft/binary lab/rough $ bun drizzle-kit push:pg
drizzle-kit: v0.19.13
drizzle-orm: v0.28.6

No config path provided, using default path
Reading config file '/mnt/t/Projects/AGSCraft/binary lab/rough/drizzle.config.ts'
error: column "id" cannot be cast automatically to type uuid
    at Parser.parseErrorMessage (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40722:98)
    at Parser.handlePacket (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40563:25)
    at Parser.parse (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40487:34)
    at Socket.<anonymous> (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40763:44)
    at Socket.emit (node:events:515:28)
    at addChunk (node:internal/streams/readable:545:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
    at Readable.push (node:internal/streams/readable:375:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 169,
  severity: 'ERROR',
  code: '42804',
  detail: undefined,
  hint: 'You might need to specify "USING id::uuid".',
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'tablecmds.c',
  line: '12332',
  routine: 'ATPrepAlterColumnType'
}
tomri:/mnt/t/Projects/AGSCraft/binary lab/rough $ bun drizzle-kit push:pg
drizzle-kit: v0.19.13
drizzle-orm: v0.28.6

No config path provided, using default path
Reading config file '/mnt/t/Projects/AGSCraft/binary lab/rough/drizzle.config.ts'
error: column "id" cannot be cast automatically to type uuid
    at Parser.parseErrorMessage (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40722:98)
    at Parser.handlePacket (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40563:25)
    at Parser.parse (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40487:34)
    at Socket.<anonymous> (/mnt/t/Projects/AGSCraft/binary lab/rough/node_modules/drizzle-kit/index.cjs:40763:44)
    at Socket.emit (node:events:515:28)
    at addChunk (node:internal/streams/readable:545:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:495:3)
    at Readable.push (node:internal/streams/readable:375:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 169,
  severity: 'ERROR',
  code: '42804',
  detail: undefined,
  hint: 'You might need to specify "USING id::uuid".',
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'tablecmds.c',
  line: '12332',
  routine: 'ATPrepAlterColumnType'
}
image.png
image.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

column "player_id" cannot be cast automatically to type uuid in drizzle ORM
Drizzle TeamDTDrizzle Team / help
2y ago
Column _ cannot be cast automatically to type integer
Drizzle TeamDTDrizzle Team / help
3y ago
column "summary" cannot be cast automatically to type jsonb
Drizzle TeamDTDrizzle Team / help
3y ago
Cannot be cast automatically
Drizzle TeamDTDrizzle Team / help
11mo ago