<?php

/**
 * Description of DB
 *
 * @author Arkadiusz Rychlik <a.rychlik at eppe.com.pl>
 */
class Main_Core_Module_Initer_DB {

	static $sql_before = "
		SET foreign_key_checks = 0;
		DROP TABLE IF EXISTS draft;
		DROP TABLE IF EXISTS role;
		SET foreign_key_checks = 1;
	";
	static $sql_after = "
		ALTER TABLE  `role` ADD UNIQUE (  `name` );
		ALTER TABLE `user` ADD UNIQUE `email` (`email`);
	";

	static function init() {
		empty(static::$sql_before) || R::exec(static::$sql_before);
		empty(static::$sql_after) || R::exec(static::$sql_after);
	}

}
