diff options
| author | 2023-10-31 02:01:50 +0100 | |
|---|---|---|
| committer | 2023-10-31 02:01:50 +0100 | |
| commit | ad8bae5acadcda0291c3a6ca579303dbd4053f04 (patch) | |
| tree | ab6a7ce2bca239a18e50ff027613bf0116135614 /app/Models/DatabaseDAO.php | |
| parent | 4207f2a5b2d84dbbc18ef6b277345e7e723f35c1 (diff) | |
Rework SQL field length (#5788)
* SQL auto-update field length
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5756
Only for PostgreSQL and MySQL / MariaDB. Not possible for SQLite
* Account for MySQL 65535
Partial revert of https://github.com/FreshRSS/FreshRSS/pull/5756
> The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead.
Diffstat (limited to 'app/Models/DatabaseDAO.php')
| -rw-r--r-- | app/Models/DatabaseDAO.php | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php index 45fc1967c..1f31f161a 100644 --- a/app/Models/DatabaseDAO.php +++ b/app/Models/DatabaseDAO.php @@ -214,22 +214,14 @@ SQL; return $ok; } - private function ensureYear2038Compatible(): bool { - if ($this->pdo->dbType() !== 'sqlite') { - include_once(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php'); - if ($this->pdo->exec($GLOBALS['SQL_UPDATE_YEAR_2038']) === false) { //FreshRSS 1.23 - Minz_Log::error('SQL error ' . __METHOD__ . json_encode($this->pdo->errorInfo())); - return false; - } - } - return true; - } - public function minorDbMaintenance(): void { $catDAO = FreshRSS_Factory::createCategoryDao(); $catDAO->resetDefaultCategoryName(); - $this->ensureYear2038Compatible(); + include_once(APP_PATH . '/SQL/install.sql.' . $this->pdo->dbType() . '.php'); + if (!empty($GLOBALS['SQL_UPDATE_MINOR']) && $this->pdo->exec($GLOBALS['SQL_UPDATE_MINOR']) === false) { + Minz_Log::error('SQL error ' . __METHOD__ . json_encode($this->pdo->errorInfo())); + } } private static function stdError(string $error): bool { |
