1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateMentalityDrillsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('mentality_drills', function (Blueprint $table) {
- $table->id();
-
- $table->bigInteger('category_id')->comment('分类id')->index();
- $table->string('title')->comment('标题');
- $table->string('subtitle')->nullable()->comment('副标题');
- $table->string('pic')->comment('图片');
- $table->longText('content')->comment('内容');
- $table->integer('number_of_studies')->default(0)->comment('学习次数')->index();
- $table->bigInteger('rank')->default(0)->comment('排序 越大越前')->index();
-
- $table->timestamps();
- $table->softDeletes();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('mentality_drills');
- }
- }
|