Files
cod-backend/Sources/App/Migrations/CreateMatch.swift
Michael Simard 676a55d2df init
2020-05-25 23:32:28 -05:00

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