Class
Comments
public final class Comments: Model
Representation of Comments table
Relationships
Conforms To
Model
Initializers
init()
public init()
init(id:body:author:article:createdAt:updatedAt:)
public init( id: Int? = nil, body: String, author: Int, article: Int, createdAt: Date? = nil, updatedAt: Date? = nil )
Default initializer
Parameters
Name | Type | Description |
---|---|---|
id | Int? |
See |
body | String |
See |
author | Int |
See |
article | Int |
See |
createdAt | Date? |
See |
updatedAt | Date? |
See |
Properties
schema
public static let schema = "Comments"
id
@ID(custom: .id, generatedBy: .database)
public var id: Int?
A Identifier.
It is assumed that the value is entered on the Database side. The application does not change this value usually.
createdAt
@Field(key: "createdAt")
public var createdAt: Date?
A created date.
It is assumed that the value is entered on the Database side. The application does not change this value usually.
updatedAt
@Field(key: "updatedAt")
public var updatedAt: Date?
A updated date.
It is assumed that the value is entered on the Database side. The application does not change this value usually.
Methods
create(on:)
public static func create(on database: MySQLDatabase) -> EventLoopFuture<Void>
Execute SQL statement for table creation.
In general, you should use features provided by the following standards: https://docs.vapor.codes/3.0/fluent/models/#create
Parameters
Name | Type | Description |
---|---|---|
connection | A established connection. |