protected static function upgradeClosed()
    {
        $objDB = self::DB();

        // Change isclosed to iseditable, iscreatable and isdeleteable.
        if ($objDB->tableExists('tl_metamodel_dca', null, true)
            && !$objDB->fieldExists('iseditable', 'tl_metamodel_dca')) {
            // Create the column in the database and copy the data over.
            TableManipulation::createColumn(
                'tl_metamodel_dca',
                'iseditable',
                'char(1) NOT NULL default \'\''
            );
            TableManipulation::createColumn(
                'tl_metamodel_dca',
                'iscreatable',
                'char(1) NOT NULL default \'\''
            );
            TableManipulation::createColumn(
                'tl_metamodel_dca',
                'isdeleteable',
                'char(1) NOT NULL default \'\''
            );

            $objDB->execute('
                UPDATE tl_metamodel_dca
                SET
                    iseditable=isclosed^1,
                    iscreatable=isclosed^1,
                    isdeleteable=isclosed^1
            ');

            TableManipulation::dropColumn('tl_metamodel_dca', 'isclosed', true);
        }
    }