<?php

class Migration_20240904112219_vinyle_printed_orders
{
    public static function up(PDO $pdo)
    {
        $sql = "
        CREATE TABLE vinyl_printed_orders (
            id INT AUTO_INCREMENT PRIMARY KEY,
            orderId VARCHAR(50) NOT NULL,
            qrCodeId INT NOT NULL,
            orderedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
            orderBy VARCHAR(255) NOT NULL,
            quantity INT NOT NULL DEFAULT 1,
            type VARCHAR(255) NOT NULL,
            size VARCHAR(50) NULL,
            status VARCHAR(50) NOT NULL DEFAULT 'pending',
            shippedAt DATETIME NULL,
            shippingAddress TEXT NULL,
            FOREIGN KEY (qrCodeId) REFERENCES qr_code(id)
        );
    ";

        $pdo->exec($sql);
    }

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