<?php
declare(strict_types=1);

return function (\App\Core\Database $db): void {
    $exists = $db->selectOne(
        "SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 'sa_games' AND column_name = 'pricing_type'"
    );
    if (!$exists) {
        $db->raw("ALTER TABLE `sa_games` ADD COLUMN `pricing_type` VARCHAR(20) NOT NULL DEFAULT 'per_game' COMMENT 'per_game, per_hour' AFTER `fee_nonmember`");
    }
};
