CREATE TABLE IMPORT_ACTIVITY (
  ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  STATUS INTEGER UNSIGNED NOT NULL DEFAULT 0,
  INTEGRATION_DATE DATETIME not null,
  FILENAME VARCHAR(64) NOT NULL,
  USER_ID INTEGER UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`ID`)
) ENGINE = InnoDB;

CREATE TABLE IMPORT_ACTIVITY_WARNING (
  ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  IMPORT_ACTIVITY_ID INTEGER UNSIGNED NOT NULL,
  DRIVER_ID INTEGER UNSIGNED NOT NULL,
  LAST_IMPORT DATETIME NOT NULL,
  LAST_DOWNLOAD DATETIME NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE = InnoDB;

CREATE TABLE IMPORT_ACTIVITY_ANOMALY (
  ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  IMPORT_ACTIVITY_ID INTEGER UNSIGNED NOT NULL,
  ANOMALY_DAY DATE NOT NULL,
  DRIVER_ID INTEGER UNSIGNED NOT NULL,
  INITIAL blob DEFAULT NULL,
  IMPORTED blob DEFAULT NULL,
  OVERRUN INTEGER UNSIGNED NOT NULL,
  PROCESS_TYPE INTEGER UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`ID`)
) ENGINE = InnoDB;