Domain Documentation

Class Tags

public final class Tags: Model  

Representation of Tags table

Tags Tags Model Model Tags->Model

Conforms To

Model

Initializers

init()

public init()  

init(id:​article:​tag:​)

public init( id: Int?, article: Int, tag: String )  

Default initializer.

Parameters

id Int?

See id

article Int

See article

tag String

See tag

Properties

schema

public static let schema = "Tags"

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.

article

@Parent(key: "article")
    public var article: Articles

A article. It's a Articles's id.

tag

@Field(key: "tag")
    public var tag: String

A tag.

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

connection

A established connection.