1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateScalesTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('scales', function (Blueprint $table) {
- $table->id();
-
- $table->bigInteger('category_id')->comment('分类id')->index();
- $table->bigInteger('third_id')->comment('统一第三方量表id')->index();
- $table->string('title')->comment('标题');
- $table->string('subtitle')->nullable()->comment('副标题');
- $table->string('pic')->comment('图片');
- $table->longText('content')->comment('内容');
- $table->integer('time')->default(0)->comment('测试时间');
- $table->string('suitable_for_the_crowd')->nullable()->comment('适合人群');
- $table->integer('number_of_questions')->default(0)->comment('问题数');
- $table->integer('number_of_replay')->default(0)->comment('报告数');
- $table->integer('number_of_test')->default(0)->comment('测试次数')->index();
- $table->text('notice')->nullable()->comment('测试须知');
- $table->bigInteger('rank')->default(0)->comment('排序 越大越前')->index();
-
- $table->timestamps();
- $table->softDeletes();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('scales');
- }
- }
|