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

34 lines
679 B
PHP

<?php
use yii\db\Migration;
/**
* Handles the creation of table `cache`.
*/
class m170221_152736_create_cache_table extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
$this->createTable('cache', [
'id' => $this->primaryKey(),
'phone' => $this->string(),
'data' => $this->text(),
'type_id' => $this->smallInteger(2)
]);
$this->createIndex('idx_cache_phone', 'cache', 'phone');
}
/**
* @inheritdoc
*/
public function down()
{
$this->dropIndex('idx_cache_phone', 'cache');
$this->dropTable('cache');
}
}