Files
cod-backend/Sources/App/Migrations/CreateMatch.swift

20 lines
518 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", .date)
.field("roundsWon", .int)
.field("roundsLost", .int)
.create()
}
func revert(on database: Database) -> EventLoopFuture<Void> {
return database.schema("matches").delete()
}
}