<?php

class Migration_20240831173904_my_numbers
{
    public static function up(PDO $pdo)
    {
        // Your migration code here
        $sql = "
            CREATE TABLE IF NOT EXISTS my_numbers (
                id INT AUTO_INCREMENT PRIMARY KEY,
                signalwire_id INT NOT NULL,
                user_id INT NOT NULL,
                dealer_id INT NULL,
                property_id INT NULL,
                phone_number VARCHAR(50) NOT NULL UNIQUE,
                phone_sid VARCHAR(255) NULL,
                voice_url VARCHAR(255) NULL,
                sms_url VARCHAR(255) NULL,
                status_call_back_url VARCHAR(255) NULL,
                status VARCHAR(50) DEFAULT 'pending',
                created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
            );
        ";

        $pdo->exec($sql);
    }

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

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