Add some debug info

This commit is contained in:
James Cole 2022-12-11 10:32:25 +01:00
parent 034647a5ca
commit 23a8835758
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
4 changed files with 50 additions and 0 deletions

View File

@ -41,6 +41,7 @@ use FireflyIII\Models\UserGroup;
use FireflyIII\Models\Webhook;
use FireflyIII\User;
use Illuminate\Console\Command;
use Illuminate\Database\QueryException;
/**
* Class UpdateGroupInformation
@ -115,7 +116,12 @@ class UpdateGroupInformation extends Command
*/
private function updateGroupInfoForObject(User $user, UserGroup $group, string $className): void
{
try {
$result = $className::where('user_id', $user->id)->where('user_group_id', null)->update(['user_group_id' => $group->id]);
} catch(QueryException $e) {
$this->error(sprintf('Could not update group information for "%s" because of error "%s"', $className, $e->getMessage()));
return;
}
if (0 !== $result) {
$this->line(sprintf('Moved %d %s objects to the correct group.', $result, str_replace('FireflyIII\\Models\\', '', $className)));
}

View File

@ -30,6 +30,16 @@ use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class AuditLogEntry
*
* @property-read Model|\Eloquent $auditable
* @property-read Model|\Eloquent $changer
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry newQuery()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry query()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withTrashed()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withoutTrashed()
* @mixin \Eloquent
*/
class AuditLogEntry extends Model
{

View File

@ -29,6 +29,34 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Class CurrencyExchangeRate
*
* @property int $id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property string|null $deleted_at
* @property int $user_id
* @property int $from_currency_id
* @property int $to_currency_id
* @property \Illuminate\Support\Carbon $date
* @property string $rate
* @property string|null $user_rate
* @property-read \FireflyIII\Models\TransactionCurrency $fromCurrency
* @property-read \FireflyIII\Models\TransactionCurrency $toCurrency
* @property-read User $user
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate query()
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereDate($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereDeletedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereFromCurrencyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereRate($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereToCurrencyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|CurrencyExchangeRate whereUserRate($value)
* @mixin Eloquent
*/
class CurrencyExchangeRate extends Model
{

View File

@ -30,6 +30,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* Class InvitedUser
*
* @property-read User $user
* @method static \Illuminate\Database\Eloquent\Builder|InvitedUser newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|InvitedUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|InvitedUser query()
* @mixin \Eloquent
*/
class InvitedUser extends Model
{