<commit_before><commit_msg>Drop init status for transactions<commit_after><?php

use yii\db\Migration;

/**
 * Class m180929_200905_drop_init_transaction_status
 */
class m180929_200905_drop_init_transaction_status extends Migration {
    /**
     * {@inheritdoc}
     */
    public function safeUp() {
        $this->execute("UPDATE `transaction` SET `status` = 'pending' where `status` = 'init'");
        $this->execute("UPDATE `transaction_log` SET `status` = 'pending' where `status` = 'init'");

        $this->execute("ALTER TABLE `transaction_log`"
            . "CHANGE `status` `status` ENUM('pending','paid','rejected','error') "
            . "NOT NULL DEFAULT 'pending';");

        $this->execute("ALTER TABLE `transaction_log`"
            . "CHANGE `status` `status` ENUM('pending','paid','rejected','error') "
            . "NOT NULL DEFAULT 'pending';");

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown() {
        $this->execute("ALTER TABLE `transaction_log`"
            . "CHANGE `status` `status` ENUM('init','pending','paid','rejected','error') "
            . "NOT NULL DEFAULT 'pending';");

        $this->execute("ALTER TABLE `transaction_log`"
            . "CHANGE `status` `status` ENUM('init','pending','paid','rejected','error') "
            . "NOT NULL DEFAULT 'pending';");

    }

}
{'fraction_non_alphanumeric': 0.17472118959107807, 'fraction_numerical': 0.017843866171003718, 'mean_word_length': 3.042042042042042, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 9, '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': '825431', 'n_tokens_mistral': 412, 'n_tokens_neox': 396, 'n_words': 81}