     var title: String
     var body: String
     let userId: Identifier
+    var isPinned: Bool
     
     static let idKey = "id"
     static let titleKey = "title"
     static let bodyKey = "body"
+    static let isPinnedKey = "is_pinned"
     
-    init(title: String, body: String, userId: Identifier) {
+    init(title: String, body: String, userId: Identifier, isPinned: Bool = false) {
         self.title = title
         self.body = body
         self.userId = userId
+        self.isPinned = isPinned
     }
     
     init(row: Row) throws {
         title = try row.get(Note.titleKey)
         body = try row.get(Note.bodyKey)
         userId = try row.get(User.foreignIdKey)
+        isPinned = try row.get(Note.isPinnedKey)
     }
     
     func makeRow() throws -> Row {

            builder.string(Note.titleKey)
            builder.custom(Note.bodyKey, type: "text")
            builder.parent(User.self)
        }
    }
    

        try self.init(
            title: json.get(Note.titleKey),
            body: json.get(Note.bodyKey),
            userId: json.get(User.foreignIdKey),
            isPinned: json.get(Note.isPinnedKey)
        )
    }
    
