<commit_before><?php

namespace DoctrineMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20130809120824 extends AbstractMigration
{

    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql", "Migration can only be executed safely on 'postgresql'.");

        $this->addSql("ALTER TABLE filter_rule ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE questionnaire_rule ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE part ADD is_total BOOLEAN NOT NULL");
        $this->addSql("ALTER TABLE population ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE population DROP CONSTRAINT FK_B449A0084CE34BEC");
        $this->addSql("ALTER TABLE population ADD CONSTRAINT FK_B449A0084CE34BEC FOREIGN KEY (part_id) REFERENCES part (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE answer ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE answer DROP CONSTRAINT FK_DADD4A254CE34BEC");
        $this->addSql("ALTER TABLE answer ADD CONSTRAINT FK_DADD4A254CE34BEC FOREIGN KEY (part_id) REFERENCES part (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE");

        $this->addSql("INSERT INTO part (date_created, date_modified, name, is_total) VALUES (NOW(), NOW(), 'Urban', false);");
        $this->addSql("INSERT INTO part (date_created, date_modified, name, is_total) VALUES (NOW(), NOW(), 'Rural', false);");
        $this->addSql("INSERT INTO part (date_created, date_modified, name, is_total) VALUES (NOW(), NOW(), 'Total', true);");
    }

    public function down(Schema $schema)
    {
        $this->throwIrreversibleMigrationException();
    }
<commit_msg>Truncate table for easier migration<commit_after><?php

namespace DoctrineMigrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
class Version20130809120824 extends AbstractMigration
{

    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql", "Migration can only be executed safely on 'postgresql'.");

        $this->addSql("TRUNCATE part CASCADE");
        $this->addSql("TRUNCATE filter_rule CASCADE");
        $this->addSql("TRUNCATE question CASCADE");
        $this->addSql("ALTER TABLE filter_rule ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE questionnaire_rule ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE part ADD is_total BOOLEAN NOT NULL");
        $this->addSql("ALTER TABLE population ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE population DROP CONSTRAINT FK_B449A0084CE34BEC");
        $this->addSql("ALTER TABLE population ADD CONSTRAINT FK_B449A0084CE34BEC FOREIGN KEY (part_id) REFERENCES part (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE");
        $this->addSql("ALTER TABLE answer ALTER part_id SET NOT NULL");
        $this->addSql("ALTER TABLE answer DROP CONSTRAINT FK_DADD4A254CE34BEC");
        $this->addSql("ALTER TABLE answer ADD CONSTRAINT FK_DADD4A254CE34BEC FOREIGN KEY (part_id) REFERENCES part (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE");

        $this->addSql("INSERT INTO part (date_created, date_modified, name, is_total) VALUES (NOW(), NOW(), 'Urban', false);");
        $this->addSql("INSERT INTO part (date_created, date_modified, name, is_total) VALUES (NOW(), NOW(), 'Rural', false);");
        $this->addSql("INSERT INTO part (date_created, date_modified, name, is_total) VALUES (NOW(), NOW(), 'Total', true);");
    }

    public function down(Schema $schema)
    {
        $this->throwIrreversibleMigrationException();
    }

{'fraction_non_alphanumeric': 0.1177336276674025, 'fraction_numerical': 0.021584498405690457, 'mean_word_length': 4.221510883482715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '7137784', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1252, 'n_words': 359}