m160829_104745_create_table_language.php 1.04 KB
<?php
    
    use yii\db\Migration;
    
    class m160829_104745_create_table_language extends Migration
    {
        
        public function up()
        {
            $this->createTable('{{%language}}', [
                'language_id' => $this->primaryKey(),
                'url'         => $this->string()
                                      ->notNull(),
                'local'       => $this->string()
                                      ->notNull(),
                'name'        => $this->string()
                                      ->notNull(),
                'default'     => $this->boolean()
                                      ->notNull()
                                      ->defaultValue(false),
                'date_create' => $this->integer()
                                      ->notNull(),
                'date_update' => $this->integer()
                                      ->notNull(),
            ]);
        }
        
        public function down()
        {
            $this->dropTable('{{%language}}');
        }
    }