Add protocol for migration service
This commit is contained in:
parent
6642523c2b
commit
860f73b731
10 changed files with 448 additions and 208 deletions
14
Sources/DataRaft/Enums/MigrationError.swift
Normal file
14
Sources/DataRaft/Enums/MigrationError.swift
Normal 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>)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue