 //        return newSlugUrl
 //    }
 }
-
-// MARK: - Relations
-
-//extension BlogPost {
-//    var postAuthor: Parent<BlogPost, BlogUser<DatabaseType>> {
-//        return parent(\.author)
-//    }
-//
-//    var tags: Siblings<BlogPost, BlogTag<DatabaseType>, BlogPostTagPivot<DatabaseType>> {
-//        return siblings()
-//    }
-//}
-
-//// MARK: - Pagination
-//
-//extension BlogPost: Paginatable {
-//    public static var defaultPageSorts: [Sort] {
-//        return []
-//    }
-//
-//    public static var defaultPageSize: Int {
-//        return postsPerPage
-//    }
-//}
-//
-//extension Page {
-//    public func makeNode(for uri: URI, in context: Context?) throws -> Node {
-//        var node = Node([:], in: context)
-//        try node.set("data", data.makeNode(in: context))
-//
-//        var paginationNode = Node([:], in: context)
-//        try paginationNode.set("total", total)
-//        try paginationNode.set("current_page", number)
-//        try paginationNode.set("per_page", size)
-//
-//        var pages = total / size
-//        if total % size != 0 {
-//            pages += 1
-//        }
-//
-//        try paginationNode.set("total_pages", pages)
-//        if number < pages {
-//            try paginationNode.set("next_page", "?page=\(number + 1)")
-//        }
-//        if number > 1 {
-//            try paginationNode.set("previous_page", "?page=\(number - 1)")
-//        }
-//
-//        try node.set("pagination", paginationNode)
-//        return node
-//    }
-//}
-

    }
}

//extension BlogPost: Migration {}

//
//extension BlogPost: Parameterizable {}
//
//// MARK: - Node
//
//public enum BlogPostContext: Context {
//    case all
//    case shortSnippet
//    case longSnippet
//}
//
//extension BlogPost: NodeRepresentable {
//    public func makeNode(in context: Context?) throws -> Node {
//        let createdTime = created.timeIntervalSince1970
//
//        var node = Node([:], in: context)
//        try node.set(Properties.blogPostID, id)
//        try node.set(Properties.title, title)
//        try node.set(Properties.contents, contents)
//        try node.set(BlogUser.foreignIdKey, author)
//        try node.set(Properties.created, createdTime)
//        try node.set(Properties.slugUrl, slugUrl)
//        try node.set(Properties.published, published)
//
//        if let lastEdited = lastEdited {
//            try node.set(Properties.lastEdited, lastEdited.timeIntervalSince1970)
//        }
//
//        guard let providedContext = context else {
//            return node
//        }
//
//        if type(of: providedContext) != BlogPostContext.self {
//            return node
//        }
//
//        let dateFormatter = DateFormatter()
//        dateFormatter.timeZone = TimeZone(abbreviation: "UTC")
//        dateFormatter.dateStyle = .full
//        dateFormatter.timeStyle = .none
//        let createdDate = dateFormatter.string(from: created)
//
//        try node.set(Properties.authorName, postAuthor.get()?.name)
//        try node.set(Properties.authorUsername, postAuthor.get()?.username)
//        try node.set(Properties.createdDate, createdDate)
//
//        switch providedContext {
//        case BlogPostContext.shortSnippet:
//            try node.set(Properties.shortSnippet, shortSnippet())
//            break
//        case BlogPostContext.longSnippet:
//            try node.set(Properties.longSnippet, longSnippet())
//
//            let allTags = try tags.all()
//            if !allTags.isEmpty {
//                try node.set(Properties.tags, allTags)
//            }
//            break
//        case BlogPostContext.all:
//            let allTags = try tags.all()
//
//            if !allTags.isEmpty {
//                try node.set(Properties.tags, allTags)
//            }
//
//            let iso8601Formatter = DateFormatter()
//            iso8601Formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
//            iso8601Formatter.locale = Locale(identifier: "en_US_POSIX")
//            iso8601Formatter.timeZone = TimeZone(secondsFromGMT: 0)
//
//            try node.set(Properties.createdDateIso8601, iso8601Formatter.string(from: created))
//
//            if let lastEdited = lastEdited {
//                let lastEditedDate = dateFormatter.string(from: lastEdited)
//                try node.set(Properties.lastEditedDate, lastEditedDate)
//                try node.set(Properties.lastEditedDateIso8601, iso8601Formatter.string(from: lastEdited))
//            }
//            try node.set(Properties.shortSnippet, shortSnippet())
//            try node.set(Properties.longSnippet, longSnippet())
//        default: break
//        }
//
//        return node
//    }
//}
//
// MARK: - BlogPost Utilities

extension BlogPost {

// MARK: - Model

public final class BlogPost: Codable {    

    public var blogID: Int?
    public var title: String
