SQLite 3.35.0 introduced drop column support
see https://www.sqlite.org/releaselog/3_35_0.html
This commit is contained in:
parent
2cc40b2447
commit
2b2b6f2e41
@ -915,10 +915,21 @@ class Database extends AbstractData
|
|||||||
}
|
}
|
||||||
// no break, continue with updates for all newer versions
|
// no break, continue with updates for all newer versions
|
||||||
case '1.7.2':
|
case '1.7.2':
|
||||||
|
$supportsDropColumn = true;
|
||||||
|
if ($this->_type === 'sqlite') {
|
||||||
|
try {
|
||||||
|
$row = $this->_select('SELECT sqlite_version() AS "v"', array(), true);
|
||||||
|
$supportsDropColumn = version_compare($row['v'], '3.35.0', '>=');
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
$supportsDropColumn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($supportsDropColumn) {
|
||||||
$this->_db->exec(
|
$this->_db->exec(
|
||||||
'ALTER TABLE "' . $this->_sanitizeIdentifier('paste') .
|
'ALTER TABLE "' . $this->_sanitizeIdentifier('paste') .
|
||||||
'" DROP COLUMN "postdate"'
|
'" DROP COLUMN "postdate"'
|
||||||
);
|
);
|
||||||
|
}
|
||||||
// no break, continue with updates for all newer versions
|
// no break, continue with updates for all newer versions
|
||||||
default:
|
default:
|
||||||
$this->_exec(
|
$this->_exec(
|
||||||
|
Loading…
Reference in New Issue
Block a user