123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateCoursesTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('courses', function (Blueprint $table) {
- $table->id();
- $table->integer('admin_id');
- $table->integer('type')->default(0)->comment('课程类型');
- $table->integer('category_id')->default(0)->comment('分类id');
- $table->string('title')->comment('课程名');
- $table->string('labels')->default('')->comment('标签');
- $table->string('slug')->comment('slug');
- $table->string('thumb', 500)->comment('封面');
- $table->string('short_description', 500)->default('')->comment('简短介绍');
- $table->text('description')->comment('课程介绍');
- $table->timestamp('published_at')->default(null)->nullable(true)->comment('上线时间');
- $table->tinyInteger('is_rec')->default(0)->comment('推荐,0否,1是');
- $table->integer('user_count')->default(0)->comment('学习人数');
- $table->tinyInteger('comment_status')->default(0)->comment('0关闭评论,1开启评论');
- $table->tinyInteger('status')->default(1)->comment('1显示,0隐藏');
- $table->softDeletes();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('courses');
- }
- }
|