Todo app
 
 
 
 
 

14 lines
358 B

import Fluent
struct CreateTodo: AsyncMigration {
func prepare(on database: Database) async throws {
try await database.schema("todos")
.id()
.field("title", .string, .required)
.create()
}
func revert(on database: Database) async throws {
try await database.schema("todos").delete()
}
}