import { MigrationInterface, QueryRunner } from "typeorm";

export class InitSystemSettings1735900000000 implements MigrationInterface {
    name = 'InitSystemSettings1735900000000'

    public async up(queryRunner: QueryRunner): Promise<void> {
        // 插入默认系统设置
        await queryRunner.query(`
            INSERT INTO system_settings (setting_key, setting_value, description, setting_type, created_at, updated_at)
            VALUES 
            ('home_register_enabled', 'true', '首页注册功能开关', 'boolean', NOW(), NOW())
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        // 删除插入的系统设置
        await queryRunner.query(`
            DELETE FROM system_settings WHERE setting_key = 'home_register_enabled'
        `);
    }
}