123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?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视频,html富文本');
- $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->string('location', 32)
- ->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');
- }
- }
|