CategoryDAOSQLite.php 563 B

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