Skip to content

How to create a nullable/optional one-to-many foreign key relation? / Is drizzle's help bot hallucinating answers? #2531

Answered by jackkrone
j-fdion asked this question in Q&A
Discussion options

You must be logged in to vote

That worked. Here's the generated sql from the migration:

ALTER TABLE "my_table" ALTER COLUMN "user_id" SET DATA TYPE integer;--> statement-breakpoint
ALTER TABLE "my_table" ALTER COLUMN "user_id" DROP NOT NULL;

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@j-fdion
Comment options

@jackkrone
Comment options

Answer selected by j-fdion
@j-fdion
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants