mirror of
https://github.com/Floriansylvain/SnippetsManager.git
synced 2026-08-19 19:43:17 +02:00
Made category optional on Snippet table
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `Snippet` DROP FOREIGN KEY `Snippet_category_id_fkey`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Snippet` MODIFY `category_id` INTEGER NULL;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `Snippet` ADD CONSTRAINT `Snippet_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `Category`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -29,8 +29,8 @@ model Snippet {
|
||||
|
||||
user_id Int
|
||||
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
||||
category_id Int
|
||||
category Category @relation(fields: [category_id], references: [id])
|
||||
category_id Int?
|
||||
category Category? @relation(fields: [category_id], references: [id])
|
||||
language_id Int
|
||||
language Language @relation(fields: [language_id], references: [id])
|
||||
Snippet_tag Snippet_tag[]
|
||||
|
||||
Reference in New Issue
Block a user