4
0

FeedDAOSQLite.php 574 B

123456789101112131415161718192021222324
  1. <?php
  2. declare(strict_types=1);
  3. class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAOPGSQL {
  4. #[\Override]
  5. public function sqlResetSequence(): bool {
  6. return true; // Nothing to do for SQLite
  7. }
  8. /** @param array{0:string,1:int,2:string} $errorInfo */
  9. #[\Override]
  10. public function autoUpdateDb(array $errorInfo): bool {
  11. $columns = $this->fetchColumn("PRAGMA table_info('feed')", 1);
  12. if ($columns !== null) {
  13. foreach (['kind'] as $column) {
  14. if (!in_array($column, $columns, true)) {
  15. return $this->addColumn($column);
  16. }
  17. }
  18. }
  19. return false;
  20. }
  21. }