Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfiCVCgCVJZq4NDEqZs
30 lines
1.5 KiB
SQL
30 lines
1.5 KiB
SQL
-- Co-Lite change add-landing-pages: landing pages and their images.
|
|
-- Target: `service-counter`. Additive only. Run once.
|
|
SET NAMES utf8mb4;
|
|
USE `service-counter`;
|
|
CREATE TABLE `cms_page` (
|
|
`id` bigint NOT NULL AUTO_INCREMENT,
|
|
`company_id` bigint NOT NULL,
|
|
`slug` varchar(80) NOT NULL COMMENT 'Lower-case words joined by hyphens; unique per company',
|
|
`title` varchar(120) NOT NULL,
|
|
`meta_description` varchar(160) NULL,
|
|
`status` varchar(10) NOT NULL DEFAULT 'DRAFT' COMMENT 'DRAFT or PUBLISHED',
|
|
`blocks` json NOT NULL COMMENT 'Ordered list of typed blocks; replaced as a whole on save',
|
|
`created_by` varchar(255) NULL,
|
|
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
`updated_by` varchar(255) NULL,
|
|
`updated_at` datetime NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `uk_cms_page_company_slug` (`company_id`, `slug`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
CREATE TABLE `page_image` (
|
|
`id` bigint NOT NULL AUTO_INCREMENT,
|
|
`company_id` bigint NOT NULL,
|
|
`content_type` varchar(20) NOT NULL COMMENT 'image/png, image/jpeg or image/webp, from the magic bytes',
|
|
`bytes` mediumblob NOT NULL COMMENT 'At most 2 MB',
|
|
`created_by` varchar(255) NULL,
|
|
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (`id`),
|
|
KEY `idx_page_image_company` (`company_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|