Re-add database status in installation check (#8510)

* Re-add database status in installation check

It got disabled in 2014 to get a beta out.
Time to re-enable it.

Tested on SQLite.

"checkTable" now only verifies that at least the expected columns
exist, but does not fail on additional columns provided by
e.g. extensions.

Related: https://github.com/FreshRSS/FreshRSS/issues/678

* make fix-all

* i18n

* Simpler and more correct content_bin

* Fix PostgreSQL

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
Christian Weiske
2026-03-02 12:43:35 +01:00
committed by GitHub
parent 63c8fe1285
commit 560b772e43
35 changed files with 466 additions and 91 deletions

View File

@@ -361,30 +361,32 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
/**
* Check database is well-installed.
*
* @return array<string,bool> of tested values.
* @return array<string,array<string,bool>|bool> of tested values.
*/
private static function check_install_database(): array {
$status = [
'connection' => true,
'tables' => false,
'categories' => false,
'feeds' => false,
'entries' => false,
'entrytmp' => false,
'tag' => false,
'entrytag' => false,
'table' => [
'categories' => false,
'feeds' => false,
'entries' => false,
'entrytmp' => false,
'tag' => false,
'entrytag' => false,
],
];
try {
$dbDAO = FreshRSS_Factory::createDatabaseDAO();
$status['tables'] = $dbDAO->tablesAreCorrect();
$status['categories'] = $dbDAO->categoryIsCorrect();
$status['feeds'] = $dbDAO->feedIsCorrect();
$status['entries'] = $dbDAO->entryIsCorrect();
$status['entrytmp'] = $dbDAO->entrytmpIsCorrect();
$status['tag'] = $dbDAO->tagIsCorrect();
$status['entrytag'] = $dbDAO->entrytagIsCorrect();
$status['table']['categories'] = $dbDAO->categoryIsCorrect();
$status['table']['feeds'] = $dbDAO->feedIsCorrect();
$status['table']['entries'] = $dbDAO->entryIsCorrect();
$status['table']['entrytmp'] = $dbDAO->entrytmpIsCorrect();
$status['table']['tag'] = $dbDAO->tagIsCorrect();
$status['table']['entrytag'] = $dbDAO->entrytagIsCorrect();
} catch (Minz_PDOConnectionException $e) {
$status['connection'] = false;
}