Open jhhazelaar opened 1 day ago
@duncanmcclean this seems more related to the installer. Maybe it needs to run migrations before setting configs?
@ryanmitchell @duncanmcclean is there any oppose of checking if the table exists in the Statamic\Eloquent\Sites
function getSavedSites
?
Just above https://github.com/statamic/eloquent-driver/blob/65806daaefbc6a2dd999a2d48bf5e3986ff9ead8/src/Sites/Sites.php#L11 we can check if the schema exists and return the fallback conig:
$sitesTable = config('statamic.eloquent-driver.table_prefix', '').'entries';
if(! Schema::hasTable($sitesTable)) {
return $this->getFallbackConfig();
};
I've create a pull request for the above suggestion: #375
Bug description
After installing a new project with the eloquent driver and setup repository. When installing de new project trough the repository the composer install gives a error on the package discover composer script.
When installing with --no-scripts there is no error but then you can't run the migrate command. You get the same error.
The error is:
How to reproduce
Create new project with
statamic new
. Select storing content and data in de database. Select initialize repository Select your database of choice Select to store everything in the database Commit everythingThe project is now setup.
Run git clean command to mimic a new clone:
git clean -fdX
Then run
composer install
. Or aftercomposer install --no-scripts
runphp artisan migrate
Logs
Environment
Additional details
After changing the sites driver to file you can run the migration and it works. After this everything works normal