CategoryDAOSQLite.php 496 B

123456789101112131415161718
  1. <?php
  2. class FreshRSS_CategoryDAOSQLite extends FreshRSS_CategoryDAO {
  3. /** @param array<string> $errorInfo */
  4. protected function autoUpdateDb(array $errorInfo): bool {
  5. if ($tableInfo = $this->pdo->query("PRAGMA table_info('category')")) {
  6. $columns = $tableInfo->fetchAll(PDO::FETCH_COLUMN, 1);
  7. foreach (['kind', 'lastUpdate', 'error', 'attributes'] as $column) {
  8. if (!in_array($column, $columns, true)) {
  9. return $this->addColumn($column);
  10. }
  11. }
  12. }
  13. return false;
  14. }
  15. }