Browse Source

完善articles,tags数据表

Moell 9 years ago
parent
commit
de7fecfe10

+ 4 - 1
database/migrations/2016_07_25_130523_create_articles_table.php

@@ -15,13 +15,16 @@ class CreateArticlesTable extends Migration
         Schema::create('articles', function(Blueprint $table) {
             $table->increments('id');
             $table->string('title', 200)->default('')->comment('文章标题');
+            $table->string('keyword')->default('')->comment('keywords');
+            $table->string('desc')->default('')->comment('描述');
+            $table->string('tags')->defualt('')->comment('文章标签');
             $table->longText('content')->defualt('')->comment('文章内容');
             $table->integer('user_id')->default(0)->comment('文章编写人,对应users表');
             $table->integer('cate_id')->defualt(0)->comment('文章分类');
             $table->integer('comment_count')->default(0)->comment('评论数量');
             $table->integer('read_count')->default(0)->comment('阅读数量');
             $table->tinyInteger('status')->default(0)->comment('文章状态:0-公开;1-私密');
-            $table->integer('desc')->defualt(0)->comment('排序');
+            $table->integer('sort')->defualt(0)->comment('排序');
             $table->timestamps();
             $table->index('cate_id');
             $table->index('user_id');

+ 33 - 0
database/migrations/2016_08_24_162228_add_tags_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddTagsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('tags', function (Blueprint $table) {
+            $table->timestamps();
+            $table->integer('article_number')->default(0)->comment('文章数量');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('tags', function (Blueprint $table) {
+            $table->dropColumn('created_at');
+            $table->dropColumn('updated_at');
+        });
+    }
+}