Skip to content

Fresh install: artisan optimize:clear fails because the database cache store has no table #300

Description

@ogorzalka

Summary

Straight after composer create-project + pollora:install, any cache-clearing command fails:

$ php artisan optimize:clear
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.pf_cache' doesn't exist

.env ships with:

SESSION_DRIVER=database
CACHE_STORE=database

but the corresponding tables are never created — php artisan migrate reports Nothing to migrate., so the framework's own cache/session migrations either are not shipped or are not published by the installer.

Impact

optimize:clear, cache:clear and view:clear are exactly the commands you reach for while setting a project up — for instance after changing config/theme.php. Hitting a SQL error on the first one sends you looking for a database problem that does not exist.

Workaround

CACHE_STORE=file
SESSION_DRIVER=file

Suggestion

Either ship the cache/session migrations and run them during pollora:install, or default .env.example to the file driver so a fresh install is coherent on its own.

Environment

Pollora v13.4.3 · WordPress 6.9.4 · PHP 8.4.20 · Laravel 13.8.0 · MariaDB 10.11

https://claude.ai/code/session_01CtKVtFGujknnYGtcEEJD3x

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions