la_back/console/migrations/m231012_102457_create_table_table.php

32 lines
600 B
PHP
Raw Permalink Normal View History

2023-11-21 19:51:44 +03:00
<?php
use yii\db\Migration;
/**
* Handles the creation of table `{{%table}}`.
*/
class m231012_102457_create_table_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->createTable('{{%table}}', [
'id' => $this->primaryKey(),
'name' => $this->string(),
'places' => $this->integer(),
'type' => $this->string(),
'slug' => $this->string()
]);
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropTable('{{%table}}');
}
}