Refactoring

This commit is contained in:
2025-11-07 20:38:09 +02:00
parent 5566f6f6ba
commit 5bbb722b20
26 changed files with 1097 additions and 770 deletions

View File

@@ -1,14 +1,34 @@
import Foundation
import DataLiteCore
/// Errors that may occur during migration registration or execution.
/// Errors that can occur during database migration registration or execution.
///
/// ## Overview
///
/// These errors indicate problems such as duplicate migrations, failed execution, or empty
/// migration scripts.
///
/// ## Topics
///
/// ### Error Cases
/// - ``duplicateMigration(_:)``
/// - ``emptyMigrationScript(_:)``
/// - ``migrationFailed(_:_:)``
public enum MigrationError<Version: VersionRepresentable>: Error {
/// A migration with the same version or script URL was already registered.
/// Indicates that a migration with the same version or script URL has already been registered.
///
/// - Parameter migration: The duplicate migration instance.
case duplicateMigration(Migration<Version>)
/// Migration execution failed, with optional reference to the failed migration.
case migrationFailed(Migration<Version>?, Error)
/// The migration script is empty.
/// Indicates that the migration script is empty.
///
/// - Parameter migration: The migration whose script is empty.
case emptyMigrationScript(Migration<Version>)
/// Indicates that migration execution failed.
///
/// - Parameters:
/// - migration: The migration that failed, if available.
/// - error: The underlying error that caused the failure.
case migrationFailed(Migration<Version>?, Error)
}