FeedDAOSQLite.php 460 B

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