Skip to content

Cache table and migrations problem #236

@stuartcusackie

Description

@stuartcusackie

I have an old site that was built a few years back on Laravel 9 and Statamic 3; I have been upgrading it since and it's now at the latest versions.

Every time I set up a new server for this site I get the same errors:

In Connection.php line 825:
                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.cache  
  ' doesn't exist (Connection: mysql, SQL: select * from `cache` where `key`   
  in (mysite_cache_statamic-js-statamic-redirect-{md5(cp.js?v=41a0db5  
  314e2a5587e72aeb388dabb6a)}))                                                
                                                                               

In Connection.php line 407:
                                                                               
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.cache  
  ' doesn't exist

There is a migration for the 'cache' table but I cannot run my migrations or deploy the site because this package seems to be throwing an error before the migrations get to run. My workaround is to manually create the missing table via SQL.

I think there's something in this package's service provider that is preventing my migrations from running. The site is using the database for the cache driver (CACHE_DRIVER=database) - This was a workaround from another problem with Statamic and nocache.

Any idea what is going on here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions