init
This commit is contained in:
19
Sources/App/Migrations/CreateMatch.swift
Normal file
19
Sources/App/Migrations/CreateMatch.swift
Normal file
@@ -0,0 +1,19 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import Fluent
|
||||
|
||||
struct CreateTodo: Migration {
|
||||
func prepare(on database: Database) -> EventLoopFuture<Void> {
|
||||
return database.schema("todos")
|
||||
.id()
|
||||
.field("title", .string, .required)
|
||||
.create()
|
||||
}
|
||||
|
||||
func revert(on database: Database) -> EventLoopFuture<Void> {
|
||||
return database.schema("todos").delete()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user