DROP TABLE IF EXISTS `ftp_files`;
CREATE TABLE `ftp_files` ( 
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, 
  `provider` TINYINT UNSIGNED NOT NULL, 
  `filename` VARCHAR(255) NOT NULL, 
  `download_on` TIMESTAMP NULL DEFAULT NULL, 
  `processed_on` TIMESTAMP NULL DEFAULT NULL, 
  `status` TINYINT UNSIGNED NOT NULL, 
  `file_id` INT(11) UNSIGNED NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE = InnoDB;

ALTER TABLE `ftp_files` ADD INDEX idx_file_provider_id(`provider`, `file_id`);
