new tags, migration
This commit is contained in:
83
prisma/migrations/20240815100640_retagging/migration.sql
Normal file
83
prisma/migrations/20240815100640_retagging/migration.sql
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Added the required column `authorId` to the `GameSystem` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `authorId` to the `Publication` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `authorId` to the `Schema` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `originalId` to the `Schema` table without a default value. This is not possible if the table is not empty.
|
||||
- Added the required column `name` to the `Tag` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `Schema` DROP FOREIGN KEY `Schema_gameSystemId_fkey`;
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `Tag` DROP FOREIGN KEY `Tag_publicationId_fkey`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `GameSystem` ADD COLUMN `authorId` VARCHAR(191) NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Publication` ADD COLUMN `authorId` VARCHAR(191) NOT NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Schema` ADD COLUMN `authorId` VARCHAR(191) NOT NULL,
|
||||
ADD COLUMN `originalId` VARCHAR(191) NOT NULL,
|
||||
MODIFY `gameSystemId` VARCHAR(191) NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `Tag` ADD COLUMN `name` VARCHAR(191) NOT NULL,
|
||||
MODIFY `publicationId` VARCHAR(191) NULL;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `TagsOnPublications` (
|
||||
`publicationId` VARCHAR(191) NOT NULL,
|
||||
`tagId` VARCHAR(191) NOT NULL,
|
||||
|
||||
PRIMARY KEY (`publicationId`, `tagId`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `TagsOnTags` (
|
||||
`parentTagId` VARCHAR(191) NOT NULL,
|
||||
`childTagId` VARCHAR(191) NOT NULL,
|
||||
|
||||
PRIMARY KEY (`parentTagId`, `childTagId`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `User` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
`username` VARCHAR(191) NOT NULL,
|
||||
`email` VARCHAR(191) NOT NULL,
|
||||
|
||||
UNIQUE INDEX `User_email_key`(`email`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `GameSystem` ADD CONSTRAINT `GameSystem_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `Schema` ADD CONSTRAINT `Schema_gameSystemId_fkey` FOREIGN KEY (`gameSystemId`) REFERENCES `GameSystem`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `Schema` ADD CONSTRAINT `Schema_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `Publication` ADD CONSTRAINT `Publication_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `TagsOnPublications` ADD CONSTRAINT `TagsOnPublications_publicationId_fkey` FOREIGN KEY (`publicationId`) REFERENCES `Publication`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `TagsOnPublications` ADD CONSTRAINT `TagsOnPublications_tagId_fkey` FOREIGN KEY (`tagId`) REFERENCES `Tag`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `Tag` ADD CONSTRAINT `Tag_publicationId_fkey` FOREIGN KEY (`publicationId`) REFERENCES `Publication`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `TagsOnTags` ADD CONSTRAINT `TagsOnTags_parentTagId_fkey` FOREIGN KEY (`parentTagId`) REFERENCES `Tag`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `TagsOnTags` ADD CONSTRAINT `TagsOnTags_childTagId_fkey` FOREIGN KEY (`childTagId`) REFERENCES `Tag`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
Reference in New Issue
Block a user