m161031_160156_blog.php 1.31 KB
<?php
    
    use yii\db\Migration;
    
    class m161031_160156_blog extends Migration
    {
        
        public function up()
        {
            $this->createTable(
                'blog_article',
                [
                    'id'         => $this->primaryKey(),
                    'image'      => $this->string(255),
                    'created_at' => $this->integer(),
                    'updated_at' => $this->integer(),
                    'deleted_at' => $this->integer(),
                    'sort'       => $this->integer(),
                    'status'     => $this->boolean(),
                    'author_id'  => $this->integer(),
                ]
            );
            
            $this->createTable(
                'blog_article_lang',
                [
                    'title' => $this->string(255),
                    'body' => $this->text(),
                    'body_preview' => $this->text(),
                    'alias' => $this->string(255),
                    'meta_title' => $this->string(255),
                    'meta_description' => $this->string(255),
                    'h1' => $this->string(255),
                    'seo_text' => $this->string(255),
                ]
            );
        }
        
        public function down()
        {
            
        }
    }