@@ -17,33 +17,33 @@ import Vapor
17
17
import Fluent
18
18
import FluentMySQLDriver
19
19
20
- // UNCOMMENT-DATABASE to configure database example
21
- // // Content conformance will ensure that the object can be encoded and decoded from HTTP messages.
22
- // final class Employee: Model, Content {
23
- // // Name of the table or collection.
24
- // static let schema = "employees"
20
+ /// This class provides the model for an Employee
21
+ final public class Employee : Model , Content {
22
+ // Name of the table or collection.
23
+ public static let schema = " employees "
25
24
26
- // // Unique identifier for this Employee.
27
- // @ID(custom: "emp_no", generatedBy: .database)
28
- // var id: Int?
25
+ / // Unique identifier for this Employee.
26
+ @ID ( custom: " emp_no " , generatedBy: . database)
27
+ public var id : Int ?
29
28
30
- // // Additional fields for this Employee.
31
- // @Field(key: "first_name")
32
- // var firstName: String
29
+ /// First name of employee
30
+ @Field ( key: " first_name " )
31
+ public var firstName : String
33
32
34
- // @Field(key: "last_name")
35
- // var lastName: String
33
+ /// Last name of employee
34
+ @Field ( key: " last_name " )
35
+ public var lastName : String
36
36
37
- // @Field(key: "gender")
38
- // var gender: String
37
+ @Field ( key: " gender " )
38
+ public var gender : String
39
39
40
- // @Field(key: "birth_date")
41
- // var birthDate: Date
40
+ @Field ( key: " birth_date " )
41
+ public var birthDate : Date
42
42
43
- // @Field(key: "hire_date")
44
- // var hireDate: Date
43
+ @Field ( key: " hire_date " )
44
+ public var hireDate : Date
45
45
46
- // // Creates a new, empty Employee.
47
- // init() { }
48
- // }
46
+ // Creates a new, empty Employee.
47
+ public init ( ) { }
48
+ }
49
49
0 commit comments