- Добавлена таблица с логами пользователей

parent 7a13e417
<?php
use yii\db\Migration;
class m160315_022841_add_logs_table extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->createTable(
'trigger_logs',
[
'id' => $this->primaryKey(),
'user_id' => $this->integer()->notNull(),
'action' => $this->string(255)->notNull(),
'datetime' => $this->dateTime()->notNull(),
'presence_time' => $this->integer(11)
]
);
$this->addForeignKey(
'trigger_logs_user_id',
'trigger_logs', 'user_id',
'users', 'id'
);
}
public function safeDown()
{
$this->dropForeignKey(
'trigger_logs_user_id',
'trigger_logs'
);
$this->dropTable('trigger_logs');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment