fixed issue with calculating dates, added api for posting a game to the server

This commit is contained in:
Michael Simard
2020-12-09 14:11:44 -06:00
parent 26fdc1e39a
commit f10a360556
4 changed files with 67 additions and 19 deletions

View File

@@ -0,0 +1,37 @@
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()
// }
//}
struct AddCODGame2: Migration {
func prepare(on database: Database) -> EventLoopFuture<Void> {
return database.schema("match")
.field("codGame",.string)
.field("notes",.string)
.field("players",.string)
.update()
}
func revert(on database: Database) -> EventLoopFuture<Void> {
return database.schema("match23es").delete()
}
}