m160726_211227_create_artbox_comment_rating.php 1.01 KB
<?php
    
    use yii\db\Migration;
    
    class m160726_211227_create_artbox_comment_rating extends Migration
    {
        
        public function up()
        {
            $this->createTable(
                '{{%artbox_comment_rating}}',
                [
                    'id'          => $this->primaryKey(),
                    'created_at'  => $this->integer()
                                          ->notNull(),
                    'updated_at'  => $this->integer()
                                          ->notNull(),
                    'customer_id' => $this->integer(),
                    'value'       => $this->float(),
                    'model'       => $this->string()
                                          ->notNull(),
                    'model_id'    => $this->integer()
                                          ->notNull(),
                ]
            );
        }
        
        public function down()
        {
            $this->dropTable('{{%artbox_comment_rating}}');
        }
    }