CREATE TABLE `event_participation` (
	`id` int AUTO_INCREMENT NOT NULL,
	`eventId` int NOT NULL,
	`userId` int NOT NULL,
	`score` decimal(15,2) DEFAULT '0.00',
	`rewardClaimed` boolean NOT NULL DEFAULT false,
	`claimedAt` timestamp,
	`joinedAt` timestamp NOT NULL DEFAULT (now()),
	CONSTRAINT `event_participation_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `multiplier_boosts` (
	`id` int AUTO_INCREMENT NOT NULL,
	`userId` int NOT NULL,
	`multiplier` decimal(3,2) NOT NULL,
	`reason` enum('event','achievement','vip_tier','promotional','referral') NOT NULL,
	`startAt` timestamp NOT NULL,
	`endAt` timestamp NOT NULL,
	`isActive` boolean NOT NULL DEFAULT true,
	`appliedGames` json,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	CONSTRAINT `multiplier_boosts_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `seasonal_events` (
	`id` int AUTO_INCREMENT NOT NULL,
	`name` varchar(255) NOT NULL,
	`description` text,
	`type` enum('tournament','promotion','special_game','bonus_multiplier') NOT NULL,
	`status` enum('upcoming','active','completed') NOT NULL DEFAULT 'upcoming',
	`startAt` timestamp NOT NULL,
	`endAt` timestamp NOT NULL,
	`bannerUrl` text,
	`rewardType` enum('gc','sc','multiplier','exclusive_access') NOT NULL,
	`rewardAmount` int DEFAULT 0,
	`participantCount` int DEFAULT 0,
	`maxParticipants` int,
	`metadata` json,
	`createdBy` int NOT NULL,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `seasonal_events_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `social_stream` (
	`id` int AUTO_INCREMENT NOT NULL,
	`userId` int NOT NULL,
	`activityType` enum('win','achievement_unlocked','tournament_joined','vip_tier_upgrade','milestone_reached','friend_added') NOT NULL,
	`title` varchar(255) NOT NULL,
	`description` text,
	`metadata` json,
	`visibility` enum('public','friends_only','private') NOT NULL DEFAULT 'public',
	`likeCount` int NOT NULL DEFAULT 0,
	`commentCount` int NOT NULL DEFAULT 0,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	CONSTRAINT `social_stream_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE TABLE `stream_interactions` (
	`id` int AUTO_INCREMENT NOT NULL,
	`streamEntryId` int NOT NULL,
	`userId` int NOT NULL,
	`interactionType` enum('like','comment') NOT NULL,
	`content` text,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	CONSTRAINT `stream_interactions_id` PRIMARY KEY(`id`)
);
--> statement-breakpoint
CREATE INDEX `idx_event_participation_eventId` ON `event_participation` (`eventId`);--> statement-breakpoint
CREATE INDEX `idx_event_participation_userId` ON `event_participation` (`userId`);--> statement-breakpoint
CREATE INDEX `idx_multiplier_userId` ON `multiplier_boosts` (`userId`);--> statement-breakpoint
CREATE INDEX `idx_multiplier_isActive` ON `multiplier_boosts` (`isActive`);--> statement-breakpoint
CREATE INDEX `idx_multiplier_endAt` ON `multiplier_boosts` (`endAt`);--> statement-breakpoint
CREATE INDEX `idx_event_status` ON `seasonal_events` (`status`);--> statement-breakpoint
CREATE INDEX `idx_event_startAt` ON `seasonal_events` (`startAt`);--> statement-breakpoint
CREATE INDEX `idx_social_stream_userId` ON `social_stream` (`userId`);--> statement-breakpoint
CREATE INDEX `idx_social_stream_activityType` ON `social_stream` (`activityType`);--> statement-breakpoint
CREATE INDEX `idx_social_stream_createdAt` ON `social_stream` (`createdAt`);--> statement-breakpoint
CREATE INDEX `idx_stream_interactions_streamEntryId` ON `stream_interactions` (`streamEntryId`);--> statement-breakpoint
CREATE INDEX `idx_stream_interactions_userId` ON `stream_interactions` (`userId`);