Skip to content

Commit 75624e5

Browse files
feat(database): add user_id column to tb_recipes with foreign key constraint and index
1 parent e6033fd commit 75624e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ALTER TABLE tb_recipes
2+
ADD COLUMN user_id BIGINT;
3+
4+
ALTER TABLE tb_recipes
5+
ADD CONSTRAINT fk_recipes_user
6+
FOREIGN KEY (user_id)
7+
REFERENCES tb_users(id);
8+
9+
CREATE INDEX idx_recipes_user_id ON tb_recipes(user_id);

0 commit comments

Comments
 (0)