<commit_before>const Sequelize         = require("sequelize");
const hash              = require("object-hash");
const _                 = require("lodash");
const diff              = require('deep-diff').diff;
const beautify          = require('js-beautify').js_beautify;

const fs                = require("fs");
const path              = require("path");

let log                 = console.log;

const reverseSequelizeColType = function(col, prefix = 'Sequelize.') 
{
    let attrObj = col['type'];
    let options = (col['type']['options']) ? col['type']['options'] : {};

    // Sequelize.CHAR
    if (attrObj instanceof Sequelize.CHAR)
    {
        if (options.binary)
            return prefix + 'CHAR.BINARY';
            
        return prefix + 'CHAR('+options.length+')';
    }
    
    // Sequelize.STRING
    if (attrObj instanceof Sequelize.STRING)
    {
        return prefix + 'STRING' + ( (options.length) ? '('+options.length+')' : '' ) +
            ((options.binary) ? '.BINARY' : '');
    }
    
    // Sequelize.TEXT
    if (attrObj instanceof Sequelize.TEXT)
    {
        if (!options.length)
            return prefix + 'TEXT';
            
        return prefix + 'TEXT('+options.length.toLowerCase()+')';
    }
    
    // Sequelize.NUMBER:
    // INTEGER, BIGINT, FLOAT, REAL, DOUBLE
    if (attrObj instanceof Sequelize.NUMBER)
    {
        let ret = attrObj.key;
        if (options.length)
        {
            ret += '('+options.length;
            if (options.decimals)
                ret += ', ' + options.decimals;
            ret += ')';
        }
        
        ret = [ ret ];

        if (options.zerofill)
            ret.push('ZEROFILL');
            
        if (options.unsigned)
            ret.push('UNSIGNED');
        
        return prefix + ret.join('.');
    }
    
    // Sequelize.ENUM
    if (attrObj instanceof Sequelize.ENUM)
        return prefix + "ENUM('" +options.values.join("', '")+"')";

    // Simple types<commit_msg>Added DOUBLE option <commit_after>const Sequelize         = require("sequelize");
const hash              = require("object-hash");
const _                 = require("lodash");
const diff              = require('deep-diff').diff;
const beautify          = require('js-beautify').js_beautify;

const fs                = require("fs");
const path              = require("path");

let log                 = console.log;

const reverseSequelizeColType = function(col, prefix = 'Sequelize.') 
{
    let attrObj = col['type'];
    let options = (col['type']['options']) ? col['type']['options'] : {};

    // Sequelize.CHAR
    if (attrObj instanceof Sequelize.CHAR)
    {
        if (options.binary)
            return prefix + 'CHAR.BINARY';
            
        return prefix + 'CHAR('+options.length+')';
    }
    
    // Sequelize.STRING
    if (attrObj instanceof Sequelize.STRING)
    {
        return prefix + 'STRING' + ( (options.length) ? '('+options.length+')' : '' ) +
            ((options.binary) ? '.BINARY' : '');
    }
    
    // Sequelize.TEXT
    if (attrObj instanceof Sequelize.TEXT)
    {
        if (!options.length)
            return prefix + 'TEXT';
            
        return prefix + 'TEXT('+options.length.toLowerCase()+')';
    }
    
    // Sequelize.DOUBLE
    if (attrObj instanceof Sequelize.DOUBLE)
    {
        if (!options.length)
            return prefix + 'DOUBLE';

        return prefix + 'DOUBLE('+options.length.toLowerCase()+')';
    }
    
    // Sequelize.NUMBER:
    // INTEGER, BIGINT, FLOAT, REAL, DOUBLE
    if (attrObj instanceof Sequelize.NUMBER)
    {
        let ret = attrObj.key;
        if (options.length)
        {
            ret += '('+options.length;
            if (options.decimals)
                ret += ', ' + options.decimals;
            ret += ')';
        }
        
        ret = [ ret ];

        if (options.zerofill)
            ret.push('ZEROFILL');
            
        if (options.unsigned)
            ret.push('UNSIGNED');
        
        return prefix + ret.join('.');
    }
    
    // Sequelize.ENUM
    if (attrObj instanceof Sequelize.ENUM)
        return prefix + "ENUM('" +options.values.join("', '")+"')";

    // Simple types
{'fraction_non_alphanumeric': 0.14996429421566293, 'fraction_numerical': 0.0, 'mean_word_length': 1.7232663642255346, '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': '711703', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1244, 'n_words': 249}