feat(bet-provider): 添加开注商管理功能,包括增删改查接口及相关模型和迁移文件
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('bet_providers', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->string('code', 32)->unique();
|
||||
$table->string('name', 64);
|
||||
$table->boolean('is_enabled')->default(true);
|
||||
$table->unsignedInteger('sort_order')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('ticket_items', function (Blueprint $table): void {
|
||||
$table->string('provider_code', 32)->default('SG')->after('draw_id');
|
||||
$table->string('provider_name', 64)->default('Singapore')->after('provider_code');
|
||||
$table->index('provider_code', 'idx_ticket_items_provider_code');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('ticket_items', function (Blueprint $table): void {
|
||||
$table->dropIndex('idx_ticket_items_provider_code');
|
||||
$table->dropColumn(['provider_code', 'provider_name']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('bet_providers');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user