1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-02-12 10:01:52 +00:00
yii2-nomer/migrations/m180712_151901_create_email_tokents_table.php
2020-02-05 06:34:26 +03:00

35 lines
1.4 KiB
PHP

<?php
use yii\db\Migration;
/**
* Handles the creation of table `email_tokents`.
*/
class m180712_151901_create_email_tokents_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('email_tokents', [
'id' => $this->primaryKey(),
'user_id' => $this->integer(),
'uuid' => $this->string(),
'tm_create' => $this->timestamp()->defaultExpression('NOW()'),
'tm_send' => $this->timestamp()->defaultValue(null)->comment('время отправки'),
'tm_read' => $this->timestamp()->defaultValue(null)->comment('время прочтения'),
'tm_click' => $this->timestamp()->defaultValue(null)->comment('момент перехода по ссылки из письма'),
'status' => $this->smallInteger()->defaultValue(0)->comment('письмо в очереди на отправку, 1 - письмо отправлено, 2 - письмо прочитано, 3 - по ссылке был сделан переход. 4 - ошибка отправки'),
'descr' => $this->text()->defaultValue(null)->comment('причина ошибка отправки')
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropTable('email_tokents');
}
}