<?php

class Migration_20250204072754_alter_app_settings_table
{
    public static function up(PDO $pdo)
    {
        $sql = "
            ALTER TABLE app_settings 
            ADD COLUMN userid INT NOT NULL,
            ADD COLUMN user_email VARCHAR(255) DEFAULT NULL,
            ADD COLUMN starting_property_id INT NULL,
            ADD COLUMN property_id INT NULL,
            ADD CONSTRAINT fk_action_property FOREIGN KEY (property_id) REFERENCES properties(id) 
            ON DELETE SET NULL ON UPDATE CASCADE;
        ";
        $pdo->exec($sql);
    }

    public static function down(PDO $pdo)
    {
        // Rollback code here
    }
}
