<commit_before>/*
 ====================================================================

 HARDAC

 --------------------------------------------------------------------
 Copyright (c) 2016 by Krogoth of
 Ministry of Zombie Defense - http://www.mzd.org.uk/
 and contributing authors

 --------------------------------------------------------------------

 This file is part of HARDAC. See server.js for details.

 ====================================================================
 */

var log = require('./log').log;
var config = require('../config').config;

var Sequelize = require('sequelize');

var sequelize = new Sequelize(config.db_name, config.db_uid, config.db_pwd, {
    dialect: config.db_dialect,
    logging: config.db_logging,
    storage: config.db_storage,
    define: {
        //prevent sequelize from pluralizing table names
        freezeTableName: true
    }
});

var PJ = sequelize.define('pj', {
    deviceId: { type: Sequelize.STRING, allowNull: false, unique: true, primaryKey: true},
    led1: { type: Sequelize.STRING, allowNull: false, defaultValue: "R"},
    led2: { type: Sequelize.STRING, allowNull: false, defaultValue: "B"},
    ballot: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0},
    lastSeen: { type: Sequelize.DATE, allowNull: false, defaultValue: Sequelize.NOW }
});

sequelize.sync().then(function()
    {
        log.info("Database structure updated");
    }).error(function(error)
    {
        log.error("Database structure update crashed: " + error);
    }
);

// Exporting.
module.exports = {
    PJ: PJ,
    sequelize: sequelize
};<commit_msg>Cleaned up default values for movies. Clean your database accordingly...<commit_after>/*
 ====================================================================

 HARDAC

 --------------------------------------------------------------------
 Copyright (c) 2016 by Krogoth of
 Ministry of Zombie Defense - http://www.mzd.org.uk/
 and contributing authors

 --------------------------------------------------------------------

 This file is part of HARDAC. See server.js for details.

 ====================================================================
 */

var log = require('./log').log;
var config = require('../config').config;

var Sequelize = require('sequelize');

var sequelize = new Sequelize(config.db_name, config.db_uid, config.db_pwd, {
    dialect: config.db_dialect,
    logging: config.db_logging,
    storage: config.db_storage,
    define: {
        //prevent sequelize from pluralizing table names
        freezeTableName: true
    }
});

var PJ = sequelize.define('pj', {
    deviceId: { type: Sequelize.STRING, allowNull: false, unique: true, primaryKey: true},
    led1: { type: Sequelize.STRING, allowNull: false, defaultValue: "F0020002F0020002F0020002"},
    led2: { type: Sequelize.STRING, allowNull: false, defaultValue: "0F0200020F0200020F020002"},
    ballot: { type: Sequelize.INTEGER, allowNull: false, defaultValue: 0},
    lastSeen: { type: Sequelize.DATE, allowNull: false, defaultValue: Sequelize.NOW }
});

sequelize.sync().then(function()
    {
        log.info("Database structure updated");
    }).error(function(error)
    {
        log.error("Database structure update crashed: " + error);
    }
);

// Exporting.
module.exports = {
    PJ: PJ,
    sequelize: sequelize
};
{'fraction_non_alphanumeric': 0.27417896956914733, 'fraction_numerical': 0.01687255197348599, 'mean_word_length': 2.713646532438479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6554906', 'n_tokens_mistral': 983, 'n_tokens_neox': 909, 'n_words': 233}