<commit_before>import Vapor
import FluentProvider
import HTTP

enum ContentType {
    case image
    case text
    case imageText
}

final class Post: Model {
    let storage = Storage()
    
    // MARK: Properties and database keys
    
    /// The content of the post
    var content: String
    var imageUrl: String
    var userId: String?
    var likesCount: Int = 0
    
    /// The column names for `id` and `content` in the database
    static let idKey = "id"
    static let userIdKey = "user_id"
    static let contentKey = "content"
    static let imageUrlKey = "imageUrl"
    static let likesCountKey = "likesCount"

    /// Creates a new Post
    init(content: String, imageUrl: String, likesCount: Int, userId: String) {
        self.content = content
        self.imageUrl = imageUrl
        self.likesCount = likesCount
        self.userId = userId
    }

    // MARK: Fluent Serialization

    /// Initializes the Post from the
    /// database row
    init(row: Row) throws {
        content = try row.get(Post.contentKey)
        imageUrl = try row.get(Post.imageUrlKey)
        likesCount = try row.get(Post.likesCountKey)
        userId = try row.get(Post.userIdKey)
    }<commit_msg>change key name<commit_after>import Vapor
import FluentProvider
import HTTP

enum ContentType {
    case image
    case text
    case imageText
}

final class Post: Model {
    let storage = Storage()
    
    // MARK: Properties and database keys
    
    /// The content of the post
    var content: String
    var imageUrl: String
    var userId: String?
    var likesCount: Int = 0
    
    /// The column names for `id` and `content` in the database
    static let idKey = "id"
    static let userIdKey = "userId"
    static let contentKey = "content"
    static let imageUrlKey = "imageUrl"
    static let likesCountKey = "likesCount"

    /// Creates a new Post
    init(content: String, imageUrl: String, likesCount: Int, userId: String) {
        self.content = content
        self.imageUrl = imageUrl
        self.likesCount = likesCount
        self.userId = userId
    }

    // MARK: Fluent Serialization

    /// Initializes the Post from the
    /// database row
    init(row: Row) throws {
        content = try row.get(Post.contentKey)
        imageUrl = try row.get(Post.imageUrlKey)
        likesCount = try row.get(Post.likesCountKey)
        userId = try row.get(Post.userIdKey)
    }
{'fraction_non_alphanumeric': 0.0829531314807134, 'fraction_numerical': 0.0008295313148071339, 'mean_word_length': 2.3546592489568847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '492748', 'n_tokens_mistral': 701, 'n_tokens_neox': 704, 'n_words': 240}