<commit_before><?php
namespace dynamic_model;
/**
 * Authors:
 *      <NAME> (c) Elexu Technologies www.elexutech.com
 *      <NAME>      (c) DSD, SIA           www.dsd.lv
 * Distributed under MIT and AGPL Licenses
 *
 * Add this controller inside your model and it will make sure than all the 
 * fields defined in your model are also present in your SQL. If any fields
 * are missing, then ALTER table will create them. It'll also keep track of
 * types of your model fields and ALTER table repectively.
 *
 * DANGER: Using this controller on production system is VERY discouraged,
 * as it slows down database performance by doing constant "describe's".
 * Also you can loose or damage data in case of improper use.
 */

class Controller_AutoCreator_MySQL extends Controller_AutoCreator_Abstract
{
    // Mapping of field types Model => DB (should define in extended class).
    // You can use templates like {length|255} which means $field->length()
    // or $field->length or 255.
    // Also template like decimal({size|length|10},{precision|2}) should work.
    public $mapping = array(
            "int"      => "integer",
            "real"     => "decimal(15,4)", // don't use MySQLs approximate value types like float or double
            "money"    => "decimal(10,2)",
            "datetime" => "datetime",
            "date"     => "date",
            "string"   => "varchar({length|255})",
            "text"     => "text",
            "boolean"  => "bool",
        );

    // default DB field type
    public $default_type = 'varchar({length|255})';

    // MySQL engine
    public $engine = 'MyISAM'; // MyISAM | INNODB | etc.
    
    // array of SQL templates used
    // supports one level deep nested action templates
    protected $templates = array(
            // create table<commit_msg>AutoCreator: make money and real fields bigger<commit_after><?php
namespace dynamic_model;
/**
 * Authors:
 *      <NAME> (c) Elexu Technologies www.<EMAIL>
 *      <NAME>      (c) DSD, SIA           www.dsd.lv
 * Distributed under MIT and AGPL Licenses
 *
 * Add this controller inside your model and it will make sure than all the 
 * fields defined in your model are also present in your SQL. If any fields
 * are missing, then ALTER table will create them. It'll also keep track of
 * types of your model fields and ALTER table repectively.
 *
 * DANGER: Using this controller on production system is VERY discouraged,
 * as it slows down database performance by doing constant "describe's".
 * Also you can loose or damage data in case of improper use.
 */

class Controller_AutoCreator_MySQL extends Controller_AutoCreator_Abstract
{
    // Mapping of field types Model => DB (should define in extended class).
    // You can use templates like {length|255} which means $field->length()
    // or $field->length or 255.
    // Also template like decimal({size|length|10},{precision|2}) should work.
    public $mapping = array(
            "int"      => "integer",
            "real"     => "decimal(18,6)", // don't use MySQLs approximate value types like float or double
            "money"    => "decimal(14,2)",
            "datetime" => "datetime",
            "date"     => "date",
            "string"   => "varchar({length|255})",
            "text"     => "text",
            "boolean"  => "bool",
        );

    // default DB field type
    public $default_type = 'varchar({length|255})';

    // MySQL engine
    public $engine = 'MyISAM'; // MyISAM | INNODB | etc.
    
    // array of SQL templates used
    // supports one level deep nested action templates
    protected $templates = array(
            // create table
{'fraction_non_alphanumeric': 0.10730906104571585, 'fraction_numerical': 0.01149739939775527, 'mean_word_length': 2.5406976744186047, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '7053100', 'n_tokens_mistral': 1041, 'n_tokens_neox': 988, 'n_words': 399}