40 lines
1.2 KiB
PHP
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');
|
|
}
|
|
}
|