first commit

This commit is contained in:
Michael Simard
2020-05-25 20:58:43 -05:00
commit ba9bfd5e6a
13 changed files with 282 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
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()
}
}