Column _ cannot be cast automatically to type integer
I have set a
postId
column in my comments
table, in which I store the ID of the post the comment is attached too. posts.id
is of type serial
, and I set postId
to be an integer
, but I keep getting the error column "postId" cannot be cast automatically to type integer
with hint You might need to specify "USING "postId"::integer".
How can I fix this?
Full code:
3 Replies
It seems there's a bug that prevents some column updates: https://github.com/drizzle-team/drizzle-orm/issues/930
GitHub
[BUG]: error: column "role" cannot be cast automatically to type us...
What version of drizzle-orm are you using? 0.27.2 What version of drizzle-kit are you using? 0.19.10 Describe the Bug I created a table in a previous migration with a field set for text. Later, I u...
try manually using such code:
ALTER TABLE "table" ALTER COLUMN "column" SET DATA TYPE integer USING (id::integer);
Great, it worked - thanks!!