20 lines
300 B
Swift
20 lines
300 B
Swift
import Fluent
|
|
import Vapor
|
|
|
|
final class Todo: Model, Content {
|
|
static let schema = "todos"
|
|
|
|
@ID(key: .id)
|
|
var id: UUID?
|
|
|
|
@Field(key: "title")
|
|
var title: String
|
|
|
|
init() { }
|
|
|
|
init(id: UUID? = nil, title: String) {
|
|
self.id = id
|
|
self.title = title
|
|
}
|
|
}
|