<?php

class Migration_20240829105538_qr_code_template
{
    public static function up(PDO $pdo)
    {
        // SQL statement to create the qr_code table
        // qr_code_templates change to qr_code_templates
        $sql = "
         CREATE TABLE qr_code_templates (
             id INT AUTO_INCREMENT PRIMARY KEY,
             templateName VARCHAR(255) NULL,
             position_ring_color VARCHAR(255) NULL,
             position_center_color VARCHAR(255) NULL,
             position_module_color VARCHAR(255) NULL,
             frameType Int NULL,
             templateHtml LONGTEXT NULL,
             CreatedBy VARCHAR(255),
             createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
             updatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
         );
         ";
        // Execute the SQL statement
        $pdo->exec($sql);
    }

    public static function down(PDO $pdo)
    {
        $sql = "DROP TABLE IF EXISTS qr_code_templates;";
        // Execute the SQL statement
        $pdo->exec($sql);
    }
}
