fix: try db fix
All checks were successful
web/docker-ttrss/pipeline/head This commit looks good

This commit is contained in:
Julien Cabillot
2026-03-04 16:54:48 -05:00
parent 331669a4f1
commit d1ef59de72

View File

@@ -70,17 +70,8 @@ try {
echo 'Resetting theme to default ...' . PHP_EOL; echo 'Resetting theme to default ...' . PHP_EOL;
$pdo->query("UPDATE ttrss_user_prefs SET value = '' WHERE pref_name = 'USER_CSS_THEME'"); $pdo->query("UPDATE ttrss_user_prefs SET value = '' WHERE pref_name = 'USER_CSS_THEME'");
} }
} } catch (PDOException $e) {
catch (PDOException $e) { echo 'Database table not found, there is no schema anymore lets continue and see what will happen... ' . PHP_EOL;
echo 'Database table not found, applying schema... ' . PHP_EOL;
$schema = file_get_contents($confpath . '/schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql');
$schema = preg_replace('/--(.*?);/', '', $schema);
$schema = preg_replace('/[\r\n]/', ' ', $schema);
$schema = trim($schema, ' ;');
foreach (explode(';', $schema) as $stm) {
$pdo->exec($stm);
}
unset($pdo); unset($pdo);
} }