prep for statistics table
This commit is contained in:
39
Sources/App/Models/Statistics.swift
Normal file
39
Sources/App/Models/Statistics.swift
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Statistics.swift
|
||||
// Statistics
|
||||
//
|
||||
// Created by Michael Simard on 8/2/21.
|
||||
//
|
||||
|
||||
import Fluent
|
||||
import Vapor
|
||||
|
||||
final class Statistics: Model {
|
||||
// Name of the table or collection.
|
||||
static let schema = "statistics"
|
||||
|
||||
@ID(key: .id)
|
||||
var id: UUID?
|
||||
|
||||
@Field(key: "title")
|
||||
var title: String
|
||||
|
||||
@Field(key: "Wins")
|
||||
var wins: Int
|
||||
|
||||
@Field(key: "losses")
|
||||
var losses: Int
|
||||
|
||||
|
||||
// Creates a new, empty .
|
||||
init() { }
|
||||
|
||||
// Creates a new with all properties set.
|
||||
init(id: UUID? = nil, title: String, wins: Int, losses: Int) {
|
||||
self.id = id
|
||||
self.title = title
|
||||
self.wins = wins
|
||||
self.losses = losses
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user