monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.71k stars 2.18k forks source link

moveavatars command does not work #5886

Open kejadlen opened 2 years ago

kejadlen commented 2 years ago

When I run the moveavatars artisan command, nothing happens. I've run it both with DEFAULT_FILESYSTEM set to s3 as well as unset (I think that's public, though the docs suggest local instead?) with --storage=s3.

I took a look at the command and the database, and my guess is that this line returns no results: https://github.com/monicahq/monica/blob/db231e34aec55a3f18656376b74fdb3395c91e81/app/Console/Commands/OneTime/MoveAvatars.php#L44, since nothing in the contacts table has has_avatar set to true, even though I do have contacts with avatars and can see some with avatar_source set to photo.

chienniman commented 1 year ago

1.Check the contacts table in your database to confirm if the has_avatar field is present and set to the correct value.

2.If the has_avatar field is missing or set to an incorrect value, you can update it using a database migration or by running a SQL query directly on the database.

3.Once you have updated the has_avatar field, try running the MoveAvatars command again to see if it works as expected.

4.If the issue persists, you can try debugging the MoveAvatars command code to see why it's not finding the contacts with avatars. You can add some dd() statements to print out the values of variables and query results to help you identify the issue.