Browse Source

Merge branch 'develop' of http://git.caihongxingqiu.net/rainbow/community-manage into develop

zhangchangchun 5 years ago
parent
commit
76aafc2ad8

+ 90 - 0
database/migrations/2019_06_03_162324_create_table_post.php

@@ -0,0 +1,90 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTablePost extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post', function (Blueprint $table) {
+            $table->bigIncrements('id');
+
+            $table->integer('uid')
+                ->index('uid')
+                ->unsigned()
+                ->comment('uid');
+
+            $table->string('username', 32)
+                ->default('')
+                ->comment('昵称');
+
+            $table->string('mobile', 16)
+                ->default('')
+                ->comment('电话');
+
+            $table->string('avatar', 255)
+                ->default('')
+                ->comment('头像');
+
+            $table->string('type', 16)
+                ->default('image')
+                ->comment('类型:image图片,video视频,text图文');
+
+            $table->string('img', 255)
+                ->comment('主图');
+
+            $table->string('video', 255)
+                ->default('')
+                ->comment('视频');
+
+            $table->string('topic_ids', 64)
+                ->default('')
+                ->comment('话题ids');
+
+            $table->string('title', 64)
+                ->default('')
+                ->comment('标题');
+
+            $table->text('content')
+                ->nullable()
+                ->comment('内容');
+
+            $table->integer('city_id')
+                ->default(0)
+                ->comment('城市id');
+
+            $table->string('city_name', 16)
+                ->default('')
+                ->comment('城市名称');
+
+            $table->tinyInteger('is_suggest')
+                ->default(0)
+                ->comment('是否推荐:0否,1是');
+
+            $table->tinyInteger('is_hide')
+                ->default(0)
+                ->comment('是否隐藏:0否,1是');
+            
+            $table->softDeletes();
+
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post');
+    }
+}

+ 96 - 0
database/migrations/2019_06_03_162403_create_table_post_data.php

@@ -0,0 +1,96 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTablePostData extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_data', function (Blueprint $table) {
+            $table->bigIncrements('id');
+
+            $table->integer('post_id')
+                ->index('post_id')
+                ->comment('帖子id');
+
+            $table->integer('pv')
+                ->default(0)
+                ->comment('pv');
+
+            $table->integer('pv_real')
+                ->default(0)
+                ->comment('实际pv');
+
+            $table->integer('dislike_count')
+                ->default(0)
+                ->comment('不喜欢数');
+
+            $table->integer('praise_count')
+                ->default(0)
+                ->comment('点赞数');
+
+            $table->integer('praise_real_count')
+                ->default(0)
+                ->comment('实际点赞数');
+
+            $table->integer('share_count')
+                ->default(0)
+                ->comment('分享数');
+
+            $table->integer('share_real_count')
+                ->default(0)
+                ->comment('实际分享数');
+
+            $table->integer('comment_count')
+                ->default(0)
+                ->comment('评论数');
+
+            $table->integer('comment_real_count')
+                ->default(0)
+                ->comment('实际评论数');
+
+            $table->integer('collect_count')
+                ->default(0)
+                ->comment('收藏数');
+
+            $table->integer('collect_real_count')
+                ->default(0)
+                ->comment('实际收藏数');
+
+            $table->integer('available_bean')
+                ->default(0)
+                ->comment('预计可获得彩虹豆数');
+
+            $table->integer('will_collect_bean')
+                ->default(0)
+                ->comment('待收货彩虹豆数');
+
+            $table->integer('collect_bean')
+                ->default(0)
+                ->comment('领取彩虹豆');
+
+            $table->decimal('weight', 8, 2)
+                ->default(0)
+                ->comment('权重');
+
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_data');
+    }
+}

+ 65 - 0
database/migrations/2019_06_03_162449_create_table_post_comment.php

@@ -0,0 +1,65 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTablePostComment extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_comment', function (Blueprint $table) {
+            $table->bigIncrements('id');
+
+            $table->integer('post_id')
+                ->index('post_id')
+                ->comment('帖子id');
+
+            $table->integer('parent_id')
+                ->default(0)
+                ->comment('评论id');
+
+            $table->integer('uid')
+                ->index('uid')
+                ->unsigned()
+                ->comment('uid');
+
+            $table->string('username', 32)
+                ->default('')
+                ->comment('昵称');
+
+            $table->string('avatar', 255)
+                ->default('')
+                ->comment('头像');
+
+            $table->string('content', 200)
+                ->default('')
+                ->comment('评论内容');
+
+            $table->integer('praise_count')
+                ->default(0)
+                ->comment('点赞数');
+            
+            $table->tinyInteger('is_delete')
+                ->default(0)
+                ->comment('是否删除:0否,1是');
+            
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_comment');
+    }
+}

+ 42 - 0
database/migrations/2019_06_03_162527_crate_table_post_imgs.php

@@ -0,0 +1,42 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CrateTablePostImgs extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_imgs', function (Blueprint $table) {
+            $table->bigIncrements('id');
+
+            $table->integer('post_id')
+                ->index('post_id')
+                ->comment('内容id');
+
+            $table->string('img', 255)
+                ->default('')
+                ->comment('图片');
+
+            $table->softDeletes();
+            
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_imgs');
+    }
+}

+ 54 - 0
database/migrations/2019_06_03_162603_crate_table_post_log.php

@@ -0,0 +1,54 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CrateTablePostLog extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('post_log', function (Blueprint $table) {
+            $table->bigIncrements('id');
+
+            $table->integer('uid')
+                ->index('uid')
+                ->unsigned()
+                ->comment('uid');
+
+            $table->integer('post_id')
+                ->index('post_id')
+                ->comment('内容id');
+
+            $table->string('username', 32)
+                ->default('')
+                ->comment('操作人');
+
+            $table->string('type', 32)
+                ->default('add_data')
+                ->comment('类型:add_data增加数据');
+            
+            $table->string('content', 500)
+                ->default('')
+                ->comment('内容');
+
+
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('post_log');
+    }
+}