<?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('channel_configs', function (Blueprint $table) {
            $table->id();
            $table->string('channel_code', 50)->unique();
            $table->string('channel_name');
            $table->string('channel_type', 50)->default('sales');
            $table->string('status', 30)->default('enabled')->index();
            $table->string('entry_path')->nullable();
            $table->boolean('supports_login')->default(false);
            $table->boolean('supports_payment')->default(false);
            $table->boolean('supports_share')->default(false);
            $table->unsignedInteger('sort')->default(0);
            $table->json('settings')->nullable();
            $table->string('remark')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('channel_configs');
    }
};
