CREATE TABLE `articles` (
	`id` int AUTO_INCREMENT NOT NULL,
	`slug` varchar(255) NOT NULL,
	`title` varchar(255) NOT NULL,
	`excerpt` text NOT NULL,
	`content` text NOT NULL,
	`heroImage` varchar(500) NOT NULL,
	`category` varchar(100) NOT NULL,
	`tags` text,
	`author` varchar(100) NOT NULL DEFAULT 'Leifo',
	`readingTime` int DEFAULT 5,
	`published` boolean DEFAULT true,
	`publishedAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	`seoMetaDescription` varchar(160),
	`seoKeywords` text,
	CONSTRAINT `articles_id` PRIMARY KEY(`id`),
	CONSTRAINT `articles_slug_unique` UNIQUE(`slug`)
);
--> statement-breakpoint
CREATE TABLE `contacts` (
	`id` int AUTO_INCREMENT NOT NULL,
	`name` varchar(255) NOT NULL,
	`email` varchar(320) NOT NULL,
	`phone` varchar(20),
	`projectType` enum('vitrine','ecommerce','webapp','autre') NOT NULL,
	`message` text NOT NULL,
	`newsletter` boolean DEFAULT false,
	`status` enum('new','read','replied','archived') NOT NULL DEFAULT 'new',
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `contacts_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `projects` (
	`id` int AUTO_INCREMENT NOT NULL,
	`slug` varchar(255) NOT NULL,
	`title` varchar(255) NOT NULL,
	`shortDescription` text NOT NULL,
	`fullDescription` text NOT NULL,
	`category` enum('vitrine','ecommerce','webapp') NOT NULL,
	`sector` varchar(100) NOT NULL,
	`clientName` varchar(255),
	`clientLogo` varchar(500),
	`mainImage` varchar(500) NOT NULL,
	`images` text,
	`technologies` text,
	`siteUrl` varchar(500),
	`completionDate` timestamp,
	`testimonial` text,
	`metrics` text,
	`featured` boolean DEFAULT false,
	`published` boolean DEFAULT true,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `projects_id` PRIMARY KEY(`id`),
	CONSTRAINT `projects_slug_unique` UNIQUE(`slug`)
);
