<?php

class Migration_20240831175838_signalwire_settings
{
    public static function up(PDO $pdo)
    {
        // Your migration code here
        $sql = "
            CREATE TABLE IF NOT EXISTS signalwire_settings (
                id INT AUTO_INCREMENT PRIMARY KEY,
                user_id INT NOT NULL,
                is_dealer boolean default 0,
                is_property boolean default 0,
                project_id VARCHAR(255) NOT NULL,
                space_url VARCHAR(255) NOT NULL,
                api_token VARCHAR(255) NOT NULL,
                dealer_purchase_number_limit INT NULL,
                is_sub_project boolean DEFAULT 0,
                sip_url  VARCHAR(255) NULL,
                created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
            );
        ";

        $pdo->exec($sql);
    }

    public static function down(PDO $pdo)
    {
        // Rollback code here
        $sql = "
            DROP TABLE IF EXISTS signalwire_settings;
        ";

        $pdo->exec($sql);
    }
}