Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Cache/APIs/Sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down