<?php

class Migration_20250326001556_create_table_mobile_sessions
{
    public static function up(PDO $pdo)
    {
        $pdo->exec("
            CREATE TABLE mobile_sessions (
                id INT AUTO_INCREMENT PRIMARY KEY,
                user_id INT NOT NULL,
                user_type VARCHAR(32) NOT NULL,
                session_id VARCHAR(64) NOT NULL,
                expires_at DATETIME NOT NULL,
                created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
                INDEX (session_id),
                INDEX (user_id),
                INDEX (user_type)
            )
        ");
    }

    public static function down(PDO $pdo)
    {
        $pdo->exec("DROP TABLE IF EXISTS mobile_sessions");
    }
}
