<commit_before>//
//  Transfer.swift
//  SmartCollaborationVapor
//
//  Created by <NAME> on 13/04/2017.
//
//

import Vapor
import Fluent

final class Transfer: Model {
    
    var id: Node?
    var player_id: Node?
    var from_club: Node?
    var to_club: String
    var transfer_date: String
    var exists: Bool = false
    
    init(player_id: Node? = nil, from_club: Node? = nil, to_club: String, transfer_date: String) {
        self.player_id = player_id
        self.from_club = from_club
        self.to_club = to_club
        self.transfer_date = transfer_date
    }
    
    init(node: Node, in context: Context) throws {
        id = try node.extract("id")
        player_id = try node.extract("player_id")
        from_club = try node.extract("from_club")
        to_club = try node.extract("to_club")
        transfer_date = try node.extract("transfer_date")
    }
    
    func makeNode(context: Context) throws -> Node {
        return try Node(node: [
            "id": id,
            "player_id": player_id,
            "from_club": from_club,
            "to_club": to_club,
            "transfer_date": transfer_date
            ])
    }
    
    static func prepare(_ database: Database) throws {
        try database.create("transfers") { transfers in
            transfers.id()
            transfers.parent(Player.self, optional: false)
            transfers.parent(Club.self, optional: false)
            transfers.string("to_club")
            transfers.string("transfer_date")
        }
    }
    <commit_msg>change transfer parameters<commit_after>//
//  Transfer.swift
//  SmartCollaborationVapor
//
//  Created by <NAME> on 13/04/2017.
//
//

import Vapor
import Fluent

final class Transfer: Model {
    
    var id: Node?
    var player_id: Node?
    var club_id: Node?
    var to_club: String
    var transfer_date: String
    var exists: Bool = false
    
    init(player_id: Node? = nil, club_id: Node? = nil, to_club: String, transfer_date: String) {
        self.player_id = player_id
        self.club_id = club_id
        self.to_club = to_club
        self.transfer_date = transfer_date
    }
    
    init(node: Node, in context: Context) throws {
        id = try node.extract("id")
        player_id = try node.extract("player_id")
        club_id = try node.extract("club_id")
        to_club = try node.extract("to_club")
        transfer_date = try node.extract("transfer_date")
    }
    
    func makeNode(context: Context) throws -> Node {
        return try Node(node: [
            "id": id,
            "player_id": player_id,
            "club_id": club_id,
            "to_club": to_club,
            "transfer_date": transfer_date
            ])
    }
    
    static func prepare(_ database: Database) throws {
        try database.create("transfers") { transfers in
            transfers.id()
            transfers.parent(Player.self, optional: false)
            transfers.parent(Club.self, optional: false)
            transfers.string("to_club")
            transfers.string("transfer_date")
        }
    }
    
{'fraction_non_alphanumeric': 0.10601626016260163, 'fraction_numerical': 0.005203252032520325, 'mean_word_length': 2.0852557673019056, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 7, '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': '7199706', 'n_tokens_mistral': 949, 'n_tokens_neox': 928, 'n_words': 224}