26 lines
392 B
Swift
26 lines
392 B
Swift
import Fluent
|
|
import Foundation
|
|
import Vapor
|
|
|
|
final class User: Model {
|
|
static let schema = "user"
|
|
|
|
@ID(key: .id)
|
|
var id: UUID?
|
|
|
|
@Field(key: "displayName")
|
|
var displayName: String
|
|
|
|
@Children(for: \.$user)
|
|
var prosAndCons: [ProCon]
|
|
|
|
init() {}
|
|
|
|
init(id: UUID? = nil, displayName: String) {
|
|
self.id = id
|
|
self.displayName = displayName
|
|
}
|
|
}
|
|
|
|
extension User: Content {}
|