Closed sdussaut closed 3 months ago
No that definitely shouldnt be happening. If you replace these lines:
with:
if (! Facades\Asset::find($container->handle().'::'.$file)) {
$asset = Facades\Asset::make()
->container($container->handle())
->path($file)
->saveQuietly();
}
does that change the behaviour for you?
Indeed it does!
Thanks a lot @ryanmitchell!
Great I’ll get that merged into the next release
One question that is maybe (?) related: is it possible to pass a single container to the command to sync (and generate presets) only for the assets of that container?
I try the following php please eloquent:sync-assets --container=myContainer
but the command seems to generate every single asset I have in every container.
Thanks!
Yep that’s already supported.
Bug description
Hi! I am using the eloquent driver with assets enabled. Assets are added outside of Statamic. When new assets come in, the sync command
php please eloquent:sync-assets
removes all previous data set on all of the already present assets.How to reproduce
php please eloquent:sync-assets
to add it to databasephp please eloquent:sync-assets
to add it to databaseLogs
No response
Environment
Additional details
I am unsure as if this is the intended behaviour or not. The documentation specifies that it will "add any missing files to the database" (emphasis is mine) not override all of them :-) Am I missing something? A flag to pass to the command to control this behaviour maybe?
Thanks!