CREATE TABLE IF NOT EXISTS `funsecretos`.`theme_progress` (
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `course_id` INT(11) UNSIGNED NOT NULL,
  `theme_id` INT(11) UNSIGNED NOT NULL,
  `user_id` INT(11) UNSIGNED NOT NULL,
  `progress` INT(11) NULL DEFAULT 0,
  `completed` TINYINT(4) NULL DEFAULT 0 COMMENT '0-Incomplete, 1-Completed',
  `created_at` TIMESTAMP NULL,
  `updated_at` TIMESTAMP NULL,
  PRIMARY KEY (`id`),
  INDEX `fk_theme_progress_users1_idx` (`user_id` ASC),
  INDEX `fk_theme_progress_courses1_idx` (`course_id` ASC),
  INDEX `fk_theme_progress_themes1_idx` (`theme_id` ASC),
  CONSTRAINT `fk_course_progress_users1`
    FOREIGN KEY (`user_id`)
    REFERENCES `funsecretos`.`users` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_course_progress_courses1`
    FOREIGN KEY (`course_id`)
    REFERENCES `funsecretos`.`courses` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_theme_progress_themes1`
    FOREIGN KEY (`theme_id`)
    REFERENCES `funsecretos`.`themes` (`id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;