feat: 完善艺术品审核变更流程
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
CREATE TABLE `artwork_revision` (
|
||||
`id` VARCHAR(191) NOT NULL,
|
||||
`artwork_id` INTEGER NOT NULL,
|
||||
`title` VARCHAR(191) NOT NULL,
|
||||
`reason` TEXT NULL,
|
||||
`before_snapshot` JSON NOT NULL,
|
||||
`after_snapshot` JSON NOT NULL,
|
||||
`status` ENUM('PENDING', 'APPROVED', 'REJECTED') NOT NULL DEFAULT 'PENDING',
|
||||
`audit_remark` TEXT NULL,
|
||||
`submitted_by` INTEGER NULL,
|
||||
`submitted_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
`reviewed_by` INTEGER NULL,
|
||||
`reviewed_at` DATETIME(3) NULL,
|
||||
|
||||
INDEX `artwork_revision_artwork_id_idx`(`artwork_id`),
|
||||
INDEX `artwork_revision_status_idx`(`status`),
|
||||
INDEX `artwork_revision_submitted_at_idx`(`submitted_at`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
ALTER TABLE `artwork_revision`
|
||||
ADD CONSTRAINT `artwork_revision_artwork_id_fkey`
|
||||
FOREIGN KEY (`artwork_id`) REFERENCES `artwork`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE `artwork_revision`
|
||||
ADD CONSTRAINT `artwork_revision_submitted_by_fkey`
|
||||
FOREIGN KEY (`submitted_by`) REFERENCES `sys_user`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE `artwork_revision`
|
||||
ADD CONSTRAINT `artwork_revision_reviewed_by_fkey`
|
||||
FOREIGN KEY (`reviewed_by`) REFERENCES `sys_user`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user