-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(prisma): add responsible table, modify adminInfo table (#27)
- Loading branch information
Showing
2 changed files
with
82 additions
and
16 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
prisma/migrations/20240307080934_admin_and_responsible_table/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `student` on the `admininfo` table. All the data in the column will be lost. | ||
- You are about to drop the column `supervisor` on the `admininfo` table. All the data in the column will be lost. | ||
- You are about to drop the column `title` on the `admininfo` table. All the data in the column will be lost. | ||
- You are about to drop the column `type` on the `admininfo` table. All the data in the column will be lost. | ||
- You are about to alter the column `status` on the `admininfo` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `Enum(EnumId(0))`. | ||
- A unique constraint covering the columns `[proposalId]` on the table `AdminInfo` will be added. If there are existing duplicate values, this will fail. | ||
- Added the required column `proposalId` to the `AdminInfo` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `admininfo` DROP COLUMN `student`, | ||
DROP COLUMN `supervisor`, | ||
DROP COLUMN `title`, | ||
DROP COLUMN `type`, | ||
ADD COLUMN `proposalId` VARCHAR(191) NOT NULL, | ||
MODIFY `status` ENUM('OPEN', 'SUBMITTED', 'IN_PROGRESS', 'UNDER_REVIEW', 'COMPLETED') NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE `userproposalsupervision` ADD COLUMN `responsibleId` VARCHAR(191) NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Responsible` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`name` VARCHAR(191) NOT NULL, | ||
`email` VARCHAR(191) NOT NULL, | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`updatedAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
|
||
UNIQUE INDEX `Responsible_id_key`(`id`), | ||
UNIQUE INDEX `Responsible_email_key`(`email`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX `AdminInfo_proposalId_key` ON `AdminInfo`(`proposalId`); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `UserProposalSupervision` ADD CONSTRAINT `UserProposalSupervision_responsibleId_fkey` FOREIGN KEY (`responsibleId`) REFERENCES `Responsible`(`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `AdminInfo` ADD CONSTRAINT `AdminInfo_proposalId_fkey` FOREIGN KEY (`proposalId`) REFERENCES `Proposal`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters