feat: Initial commit
This commit is contained in:
25
Sources/App/Models/User.swift
Normal file
25
Sources/App/Models/User.swift
Normal file
@@ -0,0 +1,25 @@
|
||||
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 {}
|
||||
Reference in New Issue
Block a user