<commit_before><?php

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20130412011506 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("CREATE TYPE questionnaire_status AS ENUM ('new', 'completed', 'validated', 'rejected');");
        $this->addSql("ALTER TABLE answer DROP status");
        $this->addSql("ALTER TABLE questionnaire ADD status questionnaire_status NOT NULL");
    }

    public function down(Schema $schema)
    {
        $this->throwIrreversibleMigrationException();<commit_msg>SQL migration crashed when data existed in database<commit_after><?php

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20130412011506 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("CREATE TYPE questionnaire_status AS ENUM ('new', 'completed', 'validated', 'rejected');");
        $this->addSql("ALTER TABLE answer DROP status");
        
        $this->addSql("ALTER TABLE questionnaire ADD status questionnaire_status");
        $this->addSql("UPDATE questionnaire SET status = 'new'");
        $this->addSql("ALTER TABLE questionnaire ALTER COLUMN status SET NOT NULL");
    }

    public function down(Schema $schema)
    {
        $this->throwIrreversibleMigrationException();
{'fraction_non_alphanumeric': 0.1180246913580247, 'fraction_numerical': 0.013827160493827161, 'mean_word_length': 4.014851485148514, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '4727253', 'n_tokens_mistral': 566, 'n_tokens_neox': 540, 'n_words': 156}