<?php

class Migration_20250127001816_create_block_numbers
{
    public static function up(PDO $pdo)
    {
        $sql = "
            CREATE TABLE IF NOT EXISTS `block_numbers` (
                `id` INT NOT NULL AUTO_INCREMENT,
                `property_id` INT NOT NULL,
                `name` TEXT NULL,
                `number` VARCHAR(12) NULL,
                `formatted_number` VARCHAR(12) NULL,
                `created_by` INT NULL,
                `type` VARCHAR(50) NULL,
                `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                PRIMARY KEY (`id`)
            )
        ";

        $pdo->exec($sql);
    }

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

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