feat: 追溯码新增分组管理与批量分组/启停接口

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 18:28:01 +08:00
co-authored by Cursor
parent a20220ccbc
commit 6578007c9e
6 changed files with 226 additions and 4 deletions
@@ -0,0 +1,18 @@
-- AlterTable
ALTER TABLE `trace_code` ADD COLUMN `group_id` INTEGER NULL;
-- CreateTable
CREATE TABLE `trace_code_group` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(191) NOT NULL,
`remark` VARCHAR(191) NULL,
`created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateIndex
CREATE INDEX `trace_code_group_id_idx` ON `trace_code`(`group_id`);
-- AddForeignKey
ALTER TABLE `trace_code` ADD CONSTRAINT `trace_code_group_id_fkey` FOREIGN KEY (`group_id`) REFERENCES `trace_code_group`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;