17 lines
342 B
Swift
17 lines
342 B
Swift
import Fluent
|
|
import Vapor
|
|
|
|
struct CreateUser: AsyncMigration {
|
|
func prepare(on database: Database) async throws {
|
|
try await database.schema("user")
|
|
.id()
|
|
.field("displayName", .string, .required)
|
|
.create()
|
|
}
|
|
|
|
func revert(on database: Database) async throws {
|
|
try await database.schema("user").delete()
|
|
}
|
|
|
|
}
|