<?php

class m130430_123630_reimport_users extends MyDbMigration
{
  public function up()
  {
    $this->execute('
      DROP TABLE IF EXISTS `users`;
      CREATE TABLE IF NOT EXISTS `users` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `username` varchar(256) NOT NULL,
        `password` varchar(256) NOT NULL,
        `email` varchar(256) NOT NULL,
        `superuser` int(1) NOT NULL DEFAULT "0",
        `status` varchar(256) NOT NULL,
        `create_time` datetime NOT NULL,
        `update_time` datetime NOT NULL,
        `first_name` varchar(255) DEFAULT NULL,
        `last_name` varchar(255) DEFAULT NULL,
        `matriculation_number` varchar(255) DEFAULT NULL,
        PRIMARY KEY (`id`),
        UNIQUE KEY `user_username` (`username`),
        UNIQUE KEY `user_email` (`email`)
      ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;


      INSERT INTO `users` (`id`, `username`, `password`, `email`, `superuser`, `status`, `create_time`, `update_time`, `first_name`, `last_name`, `matriculation_number`) VALUES
      (1, "admin", "$2a$13$l4i42CHjE1sanFDTt.XJseJr52lBzS46LX8t5iMdwVjRNMA5yx6n6", "monti.fabrizio@gmail.com", 1, "active", "2013-02-12 11:37:52", "2013-02-12 11:37:52", "Amministratore", "Super", NULL),
      (7, "policeLow", "$2a$13$FeRF5NPqCmRqA/rnEASN1O3gYdzNJ.95Y9WbFqbeYHXAHJ8ecU4wa", "policeLow@example.com", 0, "active", "2013-03-06 10:10:02", "2013-03-06 10:10:02", "policeLow", "policeLow", NULL),
      (8, "policeMedium", "$2a$13$kEWCtUk39xYhzDBdeWqkRuMvy467kP/zQezCEbpUgbYJgBWQG8Rli", "policeMedium@example.com", 0, "active", "2013-03-06 10:10:02", "2013-03-06 10:10:02", "policeMedium", "policeMedium", NULL),
      (9, "policeHigh", "$2a$13$8auLWEE4BYT2uRbwbdfbduzeB5M0C5ERqOkDzCqNb6Hyf06TTFLdm", "policeHigh@example.com", 0, "active", "2013-03-06 10:10:02", "2013-03-06 10:10:02", "policeHigh", "policeHigh", NULL),
      (10, "civilianLow", "$2a$13$BwdJ/qrcT9gH5qntNOvgmOQaf.dYaYHpC4eUx4.2PwfIbkwQR477y", "civilianLow@example.com", 0, "active", "2013-03-06 10:10:02", "2013-03-06 10:10:02", "civilianLow", "civilianLow", NULL),
      (11, "civilianHigh", "$2a$13$NxOwc.e9Lhm/fEJ9iHTIkuPlTcVhWmviYFN/DZlNQwRE1kEimpAz.", "civilianHigh@example.com", 0, "active", "2013-03-06 10:10:02", "2013-03-06 10:10:02", "civilianHigh", "civilianHigh", NULL);
    ');
  }

  public function down()
  {
    return true;
  }

}
