prep for statistics table

This commit is contained in:
Michael Simard
2021-08-02 14:48:50 -05:00
parent 15fde0b5bb
commit c38b621bdd
9 changed files with 132 additions and 56 deletions

View 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
}
}