您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

15 行
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. }