add contract, add door_log

This commit is contained in:
2016-01-25 12:50:14 +01:00
parent 0c3ff2c0f3
commit 8d29f47d49
27 changed files with 726 additions and 29 deletions

View File

@@ -0,0 +1,44 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160125_094224_add__table__door_log extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%door_log}}', [
'id_door_log' => $this->primaryKey(),
'id_card' => $this->integer(11),
'id_customer' => $this->integer(11),
'id_key' => $this->integer(11),
'direction' => $this->integer(11),
'type' => $this->integer(11),
'created_at' => $this->dateTime()->notNull(),
], $tableOptions);
}
public function down()
{
echo "m160125_094224_add__table__door_log cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}