You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
934 B

7 years ago
<?php
use yii\db\Migration;
/**
* Handles the creation of table `modules`.
*/
class m180604_205444_create_modules_table extends Migration
{
/**
* @inheritdoc
*/
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
3 years ago
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=InnoDB';
7 years ago
}
$this->createTable(
'{{%modules}}',
[
'id' => $this->primaryKey(),
'name' => $this->string(255)->notNull()->unique(),
'class' => $this->string(255)->notNull(),
'type' => $this->string(255)->notNull(), // frontend, backend, common
3 years ago
'system' => $this->integer(1)->defaultValue(0),
7 years ago
'active' => $this->integer(1)->defaultValue(1),
],
$tableOptions
);
}
/**
* @inheritdoc
*/
public function down()
{
$this->dropTable('{{%modules}}');
}
}