Files
Stella/Sources/stella/Migrations/CreateTodo.swift
2025-05-14 18:38:30 -04:00

15 lines
366 B
Swift

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