CREATE TABLE `promo_banners` (
	`id` int AUTO_INCREMENT NOT NULL,
	`title` varchar(255) NOT NULL,
	`subtitle` text,
	`description` text,
	`imageUrl` text,
	`linkUrl` text,
	`linkText` varchar(128),
	`bgGradientFrom` varchar(32) DEFAULT '#f59e0b',
	`bgGradientTo` varchar(32) DEFAULT '#d97706',
	`textColor` varchar(32) DEFAULT '#ffffff',
	`sortOrder` int NOT NULL DEFAULT 0,
	`isActive` boolean NOT NULL DEFAULT true,
	`startAt` timestamp,
	`endAt` timestamp,
	`createdByAdminId` int NOT NULL,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `promo_banners_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `user_favorites` (
	`id` int AUTO_INCREMENT NOT NULL,
	`userId` int NOT NULL,
	`gameId` int NOT NULL,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	CONSTRAINT `user_favorites_id` PRIMARY KEY(`id`),
	CONSTRAINT `idx_user_favorites_unique` UNIQUE(`userId`,`gameId`)
);
--> statement-breakpoint
CREATE INDEX `idx_promo_banners_isActive` ON `promo_banners` (`isActive`);--> statement-breakpoint
CREATE INDEX `idx_promo_banners_sortOrder` ON `promo_banners` (`sortOrder`);--> statement-breakpoint
CREATE INDEX `idx_user_favorites_userId` ON `user_favorites` (`userId`);--> statement-breakpoint
CREATE INDEX `idx_user_favorites_gameId` ON `user_favorites` (`gameId`);