erp/database/migrations/2022_10_20_095356_create_groups_table.php

50 lines
1.9 KiB
PHP
Raw Normal View History

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时有创建团失败原因');
2024-03-14 14:29:23 +08:00
$table->string('qr_code_url')->default('')->comment('create_status为1时有团小程序二维码图片地址');
2022-10-21 13:09:30 +08:00
$table->unsignedBigInteger('create_time')->nullable();
$table->unsignedTinyInteger('is_help_sell')->nullable()->comment('是否帮卖0-我发布的,1-我帮卖的');
$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');
}
}