|
- //
- // mdlLicense.swift
- //
- //
- // Created by Michiel Carman on 4/5/24.
- //
-
- import Vapor
- import Fluent
- final class mdlLicense: Model{
- static let schema = "license"
-
- @ID(custom: "id", generatedBy: .database) var id: Int?
- @Field(key: "expires") var expires: Date
-
- init(){}
-
- init(id: Int?, expires: Date){
- self.id = id!
- self.expires = expires
- }
- }
- extension mdlLicense{
- struct Create: AsyncMigration{
-
-
- func prepare(on database: FluentKit.Database) async throws {
- try await database.schema(mdlLicense.schema)
- .field("id", .int, .identifier(auto: true))
- .field("expires", .datetime)
- .create()
- }
- func revert(on database: FluentKit.Database) async throws {
- try await database.schema(mdlLicense.schema)
- .delete()
- }
-
- }
- }
|