MOON
Server: Apache
System: Linux res.emeff.ca 3.10.0-962.3.2.lve1.5.24.10.el7.x86_64 #1 SMP Wed Mar 20 07:36:02 EDT 2019 x86_64
User: accemeff (1004)
PHP: 7.0.33
Disabled: NONE
Upload Files
File: /home/accemeff/vendor/craftcms/cms/src/migrations/m170703_181539_plugins_table_tweaks.php
<?php

namespace craft\migrations;

use craft\db\Migration;
use craft\db\Table;

/**
 * m170703_181539_plugins_table_tweaks migration.
 */
class m170703_181539_plugins_table_tweaks extends Migration
{
    /**
     * @inheritdoc
     */
    public function safeUp()
    {
        // Remove lengths
        if ($this->db->getIsPgsql()) {
            // Manually construct the SQL for Postgres
            // (see https://github.com/yiisoft/yii2/issues/12077)
            $this->execute('alter table {{%plugins}} alter column [[handle]] type varchar(255), alter column [[handle]] set not null');
            $this->execute('alter table {{%plugins}} alter column [[version]] type varchar(255), alter column [[version]] set not null');
            $this->execute('alter table {{%plugins}} alter column [[schemaVersion]] type varchar(255), alter column [[schemaVersion]] set not null');
        } else {
            $this->alterColumn(Table::PLUGINS, 'handle', $this->string()->notNull());
            $this->alterColumn(Table::PLUGINS, 'version', $this->string()->notNull());
            $this->alterColumn(Table::PLUGINS, 'schemaVersion', $this->string()->notNull());
        }
    }

    /**
     * @inheritdoc
     */
    public function safeDown()
    {
        echo "m170703_181539_plugins_table_tweaks cannot be reverted.\n";
        return false;
    }
}