Add protocol for migration service

This commit is contained in:
2025-08-07 23:50:00 +03:00
parent 6642523c2b
commit 860f73b731
10 changed files with 448 additions and 208 deletions

View File

@@ -0,0 +1,14 @@
import Foundation
import DataLiteCore
/// Errors that may occur during migration registration or execution.
public enum MigrationError<Version: VersionRepresentable>: Error {
/// A migration with the same version or script URL was already registered.
case duplicateMigration(Migration<Version>)
/// Migration execution failed, with optional reference to the failed migration.
case migrationFailed(Migration<Version>?, Error)
/// The migration script is empty.
case emptyMigrationScript(Migration<Version>)
}