(NOTE: I didn't create all the log types specified here, what's most important is if the asset has any logs referencing it. And location requires DONE movement logs.)
// Test cases.
// Name -- location -- logs -- operation
// Typical duplicated plant asset
// corn 5/05/20 - -- (seeding, observation) (keep)
// corn 5/05/20 - field 1 (input) (merge, delete)
// Duplicated plant with empty plant
// beets 6/20/20 - -- (seeding, observation) (keep)
// beets 6/20/20 - field 1 (input, activity) (merge, delte)
// beets 6/20/20 - -- (none) (delete)
// Two unique assets, one empty
// squash 6/10/20 - field 1 (seeding) (keep)
// squash 6/10/20 - field 2 (seeding) (keep)
// squash 6/10/20 - -- (none) (delete)
// Assets without location or logs
// radish 3/15/20 - -- (none) (delete)
// radish 3/18/20 - -- (none) (delete)
// Rare edge case, should be two, both duplicated
// 5 - 2020 carrots - field 1
// 10 - 2020 carrots - --
// 12 - 2020 carrots - field 2
// 15 - 2020 carrots - --
$ ddev drush scr asset_dedup.php
Querying assets with duplicate names...
Duplicate: 'beets 6/20/20' Count: 3
Target location: Field 2
Asset name -- ID -- location -- log count -- operation -- url
beets 6/20/20 -- 6 -- (none) -- 2 -- keep -- https://farmos.ddev.site/asset/6
beets 6/20/20 -- 7 -- Field 2 -- 3 -- merge -- https://farmos.ddev.site/asset/7
beets 6/20/20 -- 8 -- (none) -- 0 -- delete -- https://farmos.ddev.site/asset/8
Duplicate: 'carrots 04/10/20' Count: 2
Target location: Field 1
Asset name -- ID -- location -- log count -- operation -- url
carrots 04/10/20 -- 13 -- Field 1 -- 1 -- keep -- https://farmos.ddev.site/asset/13
carrots 04/10/20 -- 14 -- (none) -- 1 -- merge -- https://farmos.ddev.site/asset/14
Duplicate: 'corn 5/05/20' Count: 4
WARNING: Duplicated assets have multiple locations.
WARNING: These assets should be manually reviewed.
Asset name -- ID -- location -- log count -- operation -- url
corn 5/05/20 -- 1 -- (none) -- 2 -- keep -- https://farmos.ddev.site/asset/1
corn 5/05/20 -- 5 -- Field 1 -- 2 -- keep -- https://farmos.ddev.site/asset/5
corn 5/05/20 -- 15 -- Field 2 -- 1 -- keep -- https://farmos.ddev.site/asset/15
corn 5/05/20 -- 16 -- (none) -- 0 -- delete -- https://farmos.ddev.site/asset/16
Duplicate: 'radish 3/15/20' Count: 2
WARNING: None of the duplicated assets have a location.
Asset name -- ID -- location -- log count -- operation -- url
radish 3/15/20 -- 11 -- (none) -- 0 -- delete -- https://farmos.ddev.site/asset/11
radish 3/15/20 -- 12 -- (none) -- 0 -- delete -- https://farmos.ddev.site/asset/12
Duplicate: 'squash 6/10/20' Count: 2
WARNING: Duplicated assets have multiple locations.
WARNING: These assets should be manually reviewed.
Asset name -- ID -- location -- log count -- operation -- url
squash 6/10/20 -- 9 -- Field 3 -- 2 -- keep -- https://farmos.ddev.site/asset/9
squash 6/10/20 -- 10 -- Field 2 -- 2 -- keep -- https://farmos.ddev.site/asset/10
Added logic to perform the operation of updating logs & delete assets.