Made category optional on Snippet table

This commit is contained in:
Florian Sylvain
2023-02-01 23:40:17 +01:00
parent cd62075dc2
commit b1f126b674
2 changed files with 10 additions and 2 deletions
@@ -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;