Closed tao closed 1 month ago
We only publish the migrations that are required for the repositories you choose.
If you run php artisan vendor:publish --tag=statamic-eloquent-entries-table-with-string-ids
manually, do you get the same error?
I couldn't run php artisan
or php please
commands without running into the issue again, so I wasn't able to manually publish the migration files...
I thought about that a bit more and uncommented this line in the Kernal.php file to stop any console commands from being imported:
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
// $this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
That seemed to help and when I rolled back my commit and installed the eloquent-driver again then it successfully published the entries migration file.
One of my custom console commands accessed the Entries facade.
public function __construct()
{
parent::__construct();
$this->entries = Entry::query()
->get()
->filter(function (EntriesEntry $entry) {
return $entry->revisions()->count() === 0;
});
}
I believe that was causing an issue because it would try get Entries before the eloquent-driver command was able to run the migration command. I guess after installing eloquent-driver it would detect that Entries should be in the database and then block the rest of the eloquent-driver commands from running because the database table didn't exist yet.
After the migrations were installed I was able to uncomment that line and it seems to be fine now.
Not sure if there is anything you can do to get around that bug...
You should run that code in your handle() method rather than the construct method, so it doesnt affect other console commands.
Awesome, seems to work smoothly now. I guess this isn't a eloquent-driver bug then but maybe it'll help someone in the future if they discover this thread 👍🏻
Bug description
When I try install the eloquent-driver I run into an issue:
The migration files don't seem to be imported into my project, when I tried this with collections selected a single migration file was added but when I examine the package contents I see there are many more migration files.
How to reproduce
php please install:eloquent-driver
Logs
Environment
Additional details
No response