2022-10-21 13:09:30 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
|
|
class CreateGroupsTable extends Migration
|
|
|
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return void
|
|
|
|
|
|
*/
|
|
|
|
|
|
public function up()
|
|
|
|
|
|
{
|
2023-04-17 18:56:59 +08:00
|
|
|
|
if (Schema::hasTable('groups')) {
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2022-10-21 13:09:30 +08:00
|
|
|
|
Schema::defaultStringLength(191);
|
|
|
|
|
|
Schema::create('groups', function (Blueprint $table) {
|
|
|
|
|
|
$table->bigIncrements('id');
|
2022-10-24 21:30:23 +08:00
|
|
|
|
$table->unsignedInteger('shop_id')->default(0);
|
|
|
|
|
|
$table->unsignedInteger('parent_id')->default(0);
|
2022-10-21 13:09:30 +08:00
|
|
|
|
$table->unsignedBigInteger('end_time');
|
|
|
|
|
|
$table->unsignedTinyInteger('is_save_preview')->comment('是否保存为预览团0-不为预览团,1-预览团');
|
|
|
|
|
|
$table->unsignedBigInteger('start_time');
|
|
|
|
|
|
$table->text('title');
|
|
|
|
|
|
$table->string('activity_no')->nullable()->comment('团号');
|
|
|
|
|
|
$table->unsignedTinyInteger('create_status')->default(3)->comment('1-创建成功,2-创建失败,3-创建中');
|
|
|
|
|
|
$table->string('error_msg')->nullable()->comment('create_status为2时有,创建团失败原因');
|
|
|
|
|
|
$table->text('qr_code_url')->nullable()->comment('create_status为1时有,团小程序二维码图片地址');
|
|
|
|
|
|
$table->unsignedBigInteger('create_time')->nullable();
|
|
|
|
|
|
$table->unsignedTinyInteger('is_help_sell')->nullable()->comment('是否帮卖0-我发布的,1-我帮卖的');
|
2022-10-23 23:54:15 +08:00
|
|
|
|
$table->tinyInteger('status')->default(-10)->comment('团状态(-10:待发布/预览中,-5:未开始,1:跟团中,20:已结束,30:已删除');
|
2022-10-21 13:09:30 +08:00
|
|
|
|
$table->timestamps();
|
|
|
|
|
|
$table->softDeletes();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return void
|
|
|
|
|
|
*/
|
|
|
|
|
|
public function down()
|
|
|
|
|
|
{
|
|
|
|
|
|
Schema::dropIfExists('groups');
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|