20 lines
522 B
Swift
20 lines
522 B
Swift
import Fluent
|
|
|
|
struct CreateMatch: Migration {
|
|
func prepare(on database: Database) -> EventLoopFuture<Void> {
|
|
return database.schema("match")
|
|
.id()
|
|
.field("map", .string)
|
|
.field("win", .bool)
|
|
.field("date", .datetime)
|
|
.field("roundsWon", .int)
|
|
.field("roundsLost", .int)
|
|
|
|
.create()
|
|
}
|
|
|
|
func revert(on database: Database) -> EventLoopFuture<Void> {
|
|
return database.schema("matches").delete()
|
|
}
|
|
}
|