<?php

class Migration_20250205025954_create_tbl_users_data
{
    public static function up(PDO $pdo)
    {
        $sql = "
            CREATE TABLE IF NOT EXISTS `users_data` (
                id INT AUTO_INCREMENT PRIMARY KEY,
                user_id INT NOT NULL,
                company_logo VARCHAR(255) NULL,
                photo_loc VARCHAR(255) NOT NULL,
                website VARCHAR(100),
                full_name VARCHAR(255) NOT NULL,
                street_address VARCHAR(255) NOT NULL,
                apartment VARCHAR(50) NULL,
                city VARCHAR(100) NOT NULL,
                state VARCHAR(100) NOT NULL,
                postal_code VARCHAR(20) NOT NULL,
                phone_number VARCHAR(20) NULL,
                created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
                deleted_at DATETIME DEFAULT NULL
            );
        ";

        $pdo->exec($sql);

        $sql = "
            INSERT INTO users_data (user_id, company_logo, photo_loc, website, full_name, street_address, apartment, city, state, postal_code, phone_number) VALUES 
            (1, '', '', '', '', '', '', '', '', '', ''), 
            (2, '', '', '', '', '', '', '', '', '', ''), 
            (3, '', '', '', '', '', '', '', '', '', '');
        ";

        $pdo->exec($sql);

    }

    public static function down(PDO $pdo)
    {
        $sql = "
            DROP TABLE IF EXISTS `user_data`;
        ";
    }
}