Rossmann-IT/yii2-cron

View on GitHub
src/migrations/m160718_111111_task_manager.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

use yii\db\Migration;

/**
 * Updates tasks table
 * @author rossmann-it
 */
class m160718_111111_task_manager extends Migration {

    /**
     * for Oracle you need to overwrite the typeMap in \yii\db\oci\QueryBuilder
     * to get an equivalent for AUTO_INCREMENT, for example
     * 'NUMBER(10) GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY'
     */
    public function safeUp() {
        $this->addColumn('tasks', 'locked', $this->boolean()->notNull()->defaultValue(0));
    }

    public function safeDown() {
        $this->dropColumn('tasks', 'locked');
    }
}