<?php
// CoreFlux/core/Database/Migration.php

namespace Core\Database;

use Doctrine\DBAL\Connection;

abstract class Migration
{
    // Abstract methods that must be implemented by concrete migration classes
    abstract public function getName(): string;

    /**
     * Apply the migration changes.
     * This method is executed when running 'db:flux' (up).
     *
     * @param SchemaBuilder $schemaBuilder The SchemaBuilder instance for schema operations.
     * @param Connection $connection The Doctrine DBAL Connection instance for raw SQL.
     */
    abstract public function up(SchemaBuilder $schemaBuilder, Connection $connection): void;

    /**
     * Revert the migration changes.
     * This method is executed when running 'db:flux rollback' (down).
     *
     * @param SchemaBuilder $schemaBuilder The SchemaBuilder instance for schema operations.
     * @param Connection $connection The Doctrine DBAL Connection instance for raw SQL.
     */
    abstract public function down(SchemaBuilder $schemaBuilder, Connection $connection): void;
}