         try json.set(Note.idKey, id)
         try json.set(Note.titleKey, title)
         try json.set(Note.bodyKey, body)
+        try json.set(Note.isPinnedKey, isPinned)
         return json
     }
 }

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

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