41 lines
1.4 KiB
PHP
41 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('templates', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name')->comment('模板名称');
|
|
$table->enum('platform', ['common', 'jd', 'pdd', 'taobao'])->default('common')->comment('平台');
|
|
$table->string('size')->comment('尺寸');
|
|
$table->text('style')->comment('样式内容');
|
|
$table->string('default_express')->nullable()->comment('默认快递公司');
|
|
$table->string('sender_name')->comment('发件人姓名');
|
|
$table->string('sender_phone')->comment('发件人电话');
|
|
$table->string('sender_address')->comment('发件人地址');
|
|
$table->boolean('show_product')->default(true)->comment('是否显示商品明细');
|
|
$table->text('remark')->nullable()->comment('备注');
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
|
|
$table->index('platform');
|
|
$table->index('name');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('templates');
|
|
}
|
|
}; |