<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration {

    public function up(): void
    {
        Schema::table('file_list', function (Blueprint $table) {
            $table->boolean('is_public')->default(false)->index()->after('cdn_url');
            $table->string('file_type', 100)->nullable()->index()->after('is_public');
        });
    }

    public function down(): void
    {
        Schema::table('file_list', function (Blueprint $table) {
            $table->dropColumn(['is_public', 'file_type']);
        });
    }
};
