text: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
  SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
  SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
  
  CREATE SCHEMA IF NOT EXISTS `splittest` DEFAULT CHARACTER SET latin1 ;
  USE `splittest` ;
  
  -- -----------------------------------------------------
  -- Table `splittest`.`users`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `splittest`.`users` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `email` VARCHAR(254) NOT NULL,
    `username` VARCHAR(32) NOT NULL DEFAULT '',
    `password` VARCHAR(64) NOT NULL,
    `logins` INT(10) UNSIGNED NOT NULL DEFAULT '0',
    `last_login` INT(10) UNSIGNED NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `uniq_username` (`username` ASC),
    UNIQUE INDEX `uniq_email` (`email` ASC))
  ENGINE = InnoDB
  AUTO_INCREMENT = 3
  DEFAULT CHARACTER SET = utf8;
  
  
  -- -----------------------------------------------------
  -- Table `splittest`.`projects`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `splittest`.`projects` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `user_id` INT(11) UNSIGNED NOT NULL,
    `name` VARCHAR(45) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `id_UNIQUE` (`id` ASC),
    INDEX `fk_projects_users1_idx` (`user_id` ASC),
    CONSTRAINT `fk_projects_users1`
      FOREIGN KEY (`user_id`)
      REFERENCES `splittest`.`users` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB
  AUTO_INCREMENT = 8
  DEFAULT CHARACTER SET = latin1;
  
  
  -- -----------------------------------------------------
  -- Table `splittest`.`pages`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `splittest`.`pages` (
    `id` INT(11) NOT NULL AUTO_INCREMENT,
    `url` VARCHAR(150) NOT NULL,
    `visitors` INT(11) NULL DEFAULT '0',
    `active_visitors` INT(11) NULL DEFAULT '0',
    `project_id` INT(11) NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `id_UNIQUE` (`id` ASC),
    INDEX `fk_pages_projects1_idx` (`project_id` ASC),
    CONSTRAINT `fk_pages_projects1`
      FOREIGN KEY (`project_id`)
      REFERENCES `splittest`.`projects` (`id`)
      ON DELETE NO ACTION
      ON UPDATE NO ACTION)
  ENGINE = InnoDB
  AUTO_INCREMENT = 15
  DEFAULT CHARACTER SET = latin1;
  
  
  -- -----------------------------------------------------
  -- Table `splittest`.`roles`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `splittest`.`roles` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(32) NOT NULL,
    `description` VARCHAR(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `uniq_name` (`name` ASC))
  ENGINE = InnoDB
  AUTO_INCREMENT = 3
  DEFAULT CHARACTER SET = utf8;
  
  INSERT INTO `roles` (`id`, `name`, `description`) VALUES(1, 'login', 'Login privileges, granted after account confirmation');
  INSERT INTO `roles` (`id`, `name`, `description`) VALUES(2, 'admin', 'Administrative user, has access to everything.');
  
  -- -----------------------------------------------------
  -- Table `splittest`.`roles_users`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `splittest`.`roles_users` (
    `user_id` INT(10) UNSIGNED NOT NULL,
    `role_id` INT(10) UNSIGNED NOT NULL,
    PRIMARY KEY (`user_id`, `role_id`),
    INDEX `fk_role_id` (`role_id` ASC),
    CONSTRAINT `roles_users_ibfk_1`
      FOREIGN KEY (`user_id`)
      REFERENCES `splittest`.`users` (`id`)
      ON DELETE CASCADE,
    CONSTRAINT `roles_users_ibfk_2`
      FOREIGN KEY (`role_id`)
      REFERENCES `splittest`.`roles` (`id`)
      ON DELETE CASCADE)
  ENGINE = InnoDB
  DEFAULT CHARACTER SET = utf8;
  
  
  -- -----------------------------------------------------
  -- Table `splittest`.`user_tokens`
  -- -----------------------------------------------------
  CREATE TABLE IF NOT EXISTS `splittest`.`user_tokens` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `user_id` INT(11) UNSIGNED NOT NULL,
    `user_agent` VARCHAR(40) NOT NULL,
    `token` VARCHAR(40) NOT NULL,
    `created` INT(10) UNSIGNED NOT NULL,
    `expires` INT(10) UNSIGNED NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `uniq_token` (`token` ASC),
    INDEX `fk_user_id` (`user_id` ASC),
    INDEX `expires` (`expires` ASC),
    CONSTRAINT `user_tokens_ibfk_1`
      FOREIGN KEY (`user_id`)
      REFERENCES `splittest`.`users` (`id`)
      ON DELETE CASCADE)
  ENGINE = InnoDB
  DEFAULT CHARACTER SET = utf8;
  
  
  SET SQL_MODE=@OLD_SQL_MODE;
  SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
  SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
  