-
-
Save maximkrouk/9ed63cc8670f57feb1ec250c14832671 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Fluent | |
extension Migrations { | |
func add(_ migration: _Migration) { _add(migration) } | |
fileprivate func _add<T: Fluent.Migration>(_ migration: T) { add(migration) } | |
} | |
struct _Migration: Migration { | |
var name: String | |
var preparation: (Database) -> EventLoopFuture<Void> | |
var revertion: (Database) -> EventLoopFuture<Void> | |
func prepare(on database: Database) -> EventLoopFuture<Void> { preparation(database) } | |
func revert(on database: Database) -> EventLoopFuture<Void> { revertion(database) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Back to index