diff --git a/Sources/Cache/APIs/Sqlite.php b/Sources/Cache/APIs/Sqlite.php index 619d50400a..ee56e75a80 100755 --- a/Sources/Cache/APIs/Sqlite.php +++ b/Sources/Cache/APIs/Sqlite.php @@ -98,9 +98,9 @@ public function connect(): bool $this->cacheDB->exec('PRAGMA journal_mode = wal;'); } - if (filesize($database) == 0) { - $this->cacheDB->exec('CREATE TABLE cache (key text unique, value blob, ttl int);'); - $this->cacheDB->exec('CREATE INDEX ttls ON cache(ttl);'); + if (filesize($database) <= 4096) { + $this->cacheDB->exec('CREATE TABLE IF NOT EXISTS cache (key text unique, value blob, ttl int);'); + $this->cacheDB->exec('CREATE INDEX IF NOT EXISTS ttls ON cache(ttl);'); } return true;