6
0
Fork 0
jiqu-library-server/database/migrations/2022_03_03_103127_create_ac...

40 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateActivitiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activities', function (Blueprint $table) {
$table->id();
$table->string('title')->comment('标题');
$table->string('cover')->nullable()->comment('封面图');
$table->text('content')->nullable()->comment('内容');
$table->unsignedTinyInteger('is_use')->default(0)->comment('是否上架');
$table->timestamp('started_at')->nullable()->comment('开始时间');
$table->timestamp('ended_at')->nullable()->comment('结束时间');
$table->json('coupons_rule')->nullable()->comment('优惠券规则');
$table->json('gifts_rule')->nullable()->comment('赠品规则');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('activities');
}
}