20 lines
458 B
Swift
20 lines
458 B
Swift
import Fluent
|
|
import Vapor
|
|
|
|
struct CreateProCon: AsyncMigration {
|
|
|
|
func prepare(on database: Database) async throws {
|
|
try await database.schema("procon")
|
|
.id()
|
|
.field("description", .string, .required)
|
|
.field("type", .string, .required)
|
|
.field("userId", .uuid, .required, .references("user", "id"))
|
|
.create()
|
|
}
|
|
|
|
func revert(on database: Database) async throws {
|
|
try await database.schema("procon").delete()
|
|
}
|
|
|
|
}
|