You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
358 B

  1. import Fluent
  2. struct CreateTodo: AsyncMigration {
  3. func prepare(on database: Database) async throws {
  4. try await database.schema("todos")
  5. .id()
  6. .field("title", .string, .required)
  7. .create()
  8. }
  9. func revert(on database: Database) async throws {
  10. try await database.schema("todos").delete()
  11. }
  12. }