Files
certd/packages/ui/certd-server/db/migration-mysql/v10049__cert_apply_template.sql
2026-06-04 01:14:21 +08:00

17 lines
836 B
SQL

CREATE TABLE `cd_cert_apply_template`
(
`id` bigint PRIMARY KEY AUTO_INCREMENT NOT NULL,
`user_id` bigint NOT NULL,
`project_id` bigint NULL,
`name` varchar(100) NOT NULL,
`content` longtext NOT NULL,
`is_default` boolean NOT NULL DEFAULT false,
`disabled` boolean NOT NULL DEFAULT false,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE = InnoDB ROW_FORMAT = DYNAMIC;
CREATE INDEX `index_cert_apply_template_user_id` ON `cd_cert_apply_template` (`user_id`);
CREATE INDEX `index_cert_apply_template_project_id` ON `cd_cert_apply_template` (`project_id`);
CREATE INDEX `index_cert_apply_template_default` ON `cd_cert_apply_template` (`user_id`, `project_id`, `is_default`);