Files
ai_web/drizzle/0005_yielding_king_bedlam.sql
2026-01-27 13:41:31 +08:00

24 lines
807 B
SQL

CREATE TABLE `websiteTagMappings` (
`id` int AUTO_INCREMENT NOT NULL,
`websiteId` int NOT NULL,
`tagId` int NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT (now()),
CONSTRAINT `websiteTagMappings_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `websiteTags` (
`id` int AUTO_INCREMENT NOT NULL,
`name` varchar(100) NOT NULL,
`slug` varchar(100) NOT NULL,
`description` text,
`color` varchar(20) DEFAULT '#6366f1',
`icon` varchar(100),
`sortOrder` int DEFAULT 0,
`isActive` boolean DEFAULT true,
`createdAt` timestamp NOT NULL DEFAULT (now()),
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT `websiteTags_id` PRIMARY KEY(`id`),
CONSTRAINT `websiteTags_name_unique` UNIQUE(`name`),
CONSTRAINT `websiteTags_slug_unique` UNIQUE(`slug`)
);