CREATE TABLE `shuAllocations` (
	`id` int AUTO_INCREMENT NOT NULL,
	`userId` int NOT NULL,
	`periodStart` date NOT NULL,
	`periodEnd` date NOT NULL,
	`allocations` text NOT NULL,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `shuAllocations_id` PRIMARY KEY(`id`),
	CONSTRAINT `shu_allocations_user_period_unique` UNIQUE(`userId`,`periodStart`,`periodEnd`)
);
--> statement-breakpoint
ALTER TABLE `shuAllocations` ADD CONSTRAINT `shuAllocations_userId_users_id_fk` FOREIGN KEY (`userId`) REFERENCES `users`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX `shu_allocations_user_period_idx` ON `shuAllocations` (`userId`,`periodStart`,`periodEnd`);