<?php

class Migration_20250225221058_create_referrals_table
{
	public static function up(PDO $pdo)
    {
        $sql = "
            CREATE TABLE IF NOT EXISTS `referrals` (
                id INT AUTO_INCREMENT PRIMARY KEY,
                user_id INT NOT NULL,
                referral_code VARCHAR(255) NULL,
                property_id VARCHAR(255) NOT NULL,
                created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
                deleted_at DATETIME DEFAULT NULL
            );
        ";

        $pdo->exec($sql);
    }

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