fuc-new/db/migrations/2023053000-add_user_coupon_use_time.php
hellcat 1fe8673f62 1
2025-10-01 13:34:29 +08:00

23 lines
527 B
PHP
Executable File

<?php
declare(strict_types=1);
use App\Interfaces\MigrationInterface;
use App\Services\DB;
return new class() implements MigrationInterface {
public function up(): int
{
DB::getPdo()->exec("ALTER TABLE user_coupon ADD COLUMN IF NOT EXISTS `use_count` int(11) NOT NULL DEFAULT 0 COMMENT '累计使用数';");
return 2023053000;
}
public function down(): int
{
DB::getPdo()->exec('ALTER TABLE user_coupon DROP COLUMN IF EXISTS `use_count`;');
return 2023050800;
}
};