|
@@ -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');
|
|
|
+ }
|
|
|
+}
|