CREATE TABLE IF NOT EXISTS `upload_progress` (
	`id` int AUTO_INCREMENT NOT NULL,
	`backup_id` varchar(255) NOT NULL,
	`device_id` varchar(255) NOT NULL,
	`file_name` varchar(500),
	`total_chunks` int NOT NULL DEFAULT 0,
	`uploaded_chunks` int NOT NULL DEFAULT 0,
	`total_size` bigint NOT NULL DEFAULT 0,
	`uploaded_size` bigint NOT NULL DEFAULT 0,
	`status` enum('pending','uploading','completed','failed') NOT NULL DEFAULT 'pending',
	`started_at` timestamp NOT NULL DEFAULT (now()),
	`completed_at` timestamp,
	`updated_at` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `upload_progress_id` PRIMARY KEY(`id`)
);
