<commit_before><?php
use Phpmig\Migration\Migration;

class AddFrenchCityNames extends Migration
{
    public function up()
    {
        $this->getZones()->set(array('data' => 'Data'));

        $this->_queries = <<<EOL
ALTER TABLE `streets_cities` DROP PRIMARY KEY;
ALTER TABLE `streets_cities` CHANGE `streets_city_id` `streets_city_identifier` INT(11) NOT NULL;

ALTER TABLE `streets_cities` AUTO_INCREMENT = 1;
ALTER TABLE `streets_cities` ADD `streets_city_id` INT  NULL  DEFAULT NULL AUTO_INCREMENT  PRIMARY KEY FIRST;

ALTER TABLE `streets_cities` CHANGE `language` `iso` VARCHAR(2) NULL;
ALTER TABLE `streets_cities` ADD UNIQUE INDEX `streets_city_identifier` (`streets_city_identifier`, `iso`);

INSERT INTO `streets_cities` (`title`, `streets_city_identifier`, `iso`, `police_zone_id`, `crab_city_id`)
VALUES
    ('Anderlecht', '21001', 'fr', '5341', '71'),
    ('Auderghem', '21002', 'fr', '5342', '72'),
    ('Berchem-Sainte-Agathe', '21003', 'fr', '5340', '73'),
    ('Bruxelles', '21004', 'fr', '5339', '74'),
    ('Etterbeek', '21005', 'fr', '5343', '75'),
    ('Evere', '21006', 'fr', '5344', '76'),
    ('Forest', '21007', 'fr', '5341', '77'),
    ('Ganshoren', '21008', 'fr', '5340', '78'),
    ('Ixelles', '21009', 'fr', '5339', '79'),
    ('Jette', '21010', 'fr', '5340', '80'),
    ('Koekelberg', '21011', 'fr', '5340', '81'),
    ('Molenbeek-Saint-Jean', '21012', 'fr', '5340', '82'),
    ('Saint-Gilles', '21013', 'fr', '5341', '83'),
    ('Saint-Josse-ten-Noode', '21014', 'fr', '5344', '84'),
    ('Schaerbeek', '21015', 'fr', '5344', '85'),
    ('Uccle', '21016', 'fr', '5342', '86'),
    ('Watermael-Boitsfort', '21017', 'fr', '5342', '87'),
    ('Woluwe-Saint-Lambert', '21018', 'fr', '5343', '88'),
    ('Woluwe-Saint-Pierre', '21019', 'fr', '5343', '89');
EOL;

        parent::up();
    }

    public function down()
    {
        $this->getZones()->set(array('data' => 'Data'));

        $this->_queries = <<<EOL
DELETE FROM `streets_cities` WHERE `iso` = 'fr' AND `streets_city_identifier` >= 21001 AND `streets_city_identifier` <= 21019;

ALTER TABLE `streets_cities` DROP INDEX `streets_city_identifier`;
ALTER TABLE `streets_cities` CHANGE `iso` `language` VARCHAR(2)  CHARACTER SET utf8  NULL  DEFAULT NULL;
ALTER TABLE `streets_cities` DROP `streets_city_id`;
ALTER TABLE `streets_cities` CHANGE `streets_city_identifier` `streets_city_id` INT(11)  UNSIGNED  NOT NULL PRIMARY KEY;


EOL;

        parent::down();
    }<commit_msg>#119 - Redo migrations, use a separate table for French translations<commit_after><?php
use Phpmig\Migration\Migration;

class AddFrenchCityNames extends Migration
{
    public function up()
    {
        $this->getZones()->set(array('data' => 'Data'));

        $this->_queries = <<<EOL
ALTER TABLE `streets_cities` DROP `language`;

CREATE TABLE `fr-be_streets_cities` LIKE `streets_cities`;
INSERT `fr-be_streets_cities` SELECT * FROM `streets_cities`.recipes;

UPDATE `fr-be_streets_cities` SET `title` = 'Anderlecht' WHERE `streets_city_id` = 21001;
UPDATE `fr-be_streets_cities` SET `title` = 'Auderghem' WHERE `streets_city_id` = 21002;
UPDATE `fr-be_streets_cities` SET `title` = 'Berchem-Sainte-Agathe' WHERE `streets_city_id` = 21003;
UPDATE `fr-be_streets_cities` SET `title` = 'Bruxelles' WHERE `streets_city_id` = 21004;
UPDATE `fr-be_streets_cities` SET `title` = 'Etterbeek' WHERE `streets_city_id` = 21005;
UPDATE `fr-be_streets_cities` SET `title` = 'Evere' WHERE `streets_city_id` = 21006;
UPDATE `fr-be_streets_cities` SET `title` = 'Forest' WHERE `streets_city_id` = 21007;
UPDATE `fr-be_streets_cities` SET `title` = 'Ganshoren' WHERE `streets_city_id` = 21008;
UPDATE `fr-be_streets_cities` SET `title` = 'Ixelles' WHERE `streets_city_id` = 21009;
UPDATE `fr-be_streets_cities` SET `title` = 'Jette' WHERE `streets_city_id` = 21010;
UPDATE `fr-be_streets_cities` SET `title` = 'Koekelberg' WHERE `streets_city_id` = 21011;
UPDATE `fr-be_streets_cities` SET `title` = 'Molenbeek-Saint-Jean' WHERE `streets_city_id` = 21012;
UPDATE `fr-be_streets_cities` SET `title` = 'Saint-Gilles' WHERE `streets_city_id` = 21013;
UPDATE `fr-be_streets_cities` SET `title` = 'Saint-Josse-ten-Noode' WHERE `streets_city_id` = 21014;
UPDATE `fr-be_streets_cities` SET `title` = 'Schaerbeek' WHERE `streets_city_id` = 21015;
UPDATE `fr-be_streets_cities` SET `title` = 'Uccle' WHERE `streets_city_id` = 21016;
UPDATE `fr-be_streets_cities` SET `title` = 'Watermael-Boitsfort' WHERE `streets_city_id` = 21017;
UPDATE `fr-be_streets_cities` SET `title` = 'Woluwe-Saint-Lambert' WHERE `streets_city_id` = 21018;
UPDATE `fr-be_streets_cities` SET `title` = 'Woluwe-Saint-Pierre' WHERE `streets_city_id` = 21019;
EOL;

        parent::up();
    }

    public function down()
    {
        $this->getZones()->set(array('data' => 'Data'));

        $this->_queries = <<<EOL
DROP TABLE `fr-be_streets_cities`;

ALTER TABLE `streets_cities` ADD `language` varchar(2) DEFAULT NULL AFTER `title`;
EOL;

        parent::down();
    }
{'fraction_non_alphanumeric': 0.17504506308832365, 'fraction_numerical': 0.06529140797115962, 'mean_word_length': 5.112607099143207, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 20, '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': '4670726', 'n_tokens_mistral': 2190, 'n_tokens_neox': 1946, 'n_words': 441}