mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
remove html_backup column from backups tables
This commit is contained in:
parent
18ce82ceed
commit
9c16c12ee9
@ -182,9 +182,7 @@ class ActivityController extends BaseController
|
||||
} else {
|
||||
$html_backup = file_get_contents(Storage::disk(config('filesystems.default'))->path($backup->filename));
|
||||
}
|
||||
} elseif ($backup && $backup->html_backup) { //db
|
||||
$html_backup = $backup->html_backup;
|
||||
} elseif (! $backup || ! $backup->html_backup) { //failed
|
||||
} else { //failed
|
||||
return response()->json(['message'=> ctrans('texts.no_backup_exists'), 'errors' => new stdClass], 404);
|
||||
}
|
||||
|
||||
|
@ -36,15 +36,11 @@ class Backup extends BaseModel
|
||||
$filename = now()->format('Y_m_d').'_'.md5(time()).'.html';
|
||||
$file_path = $path.$filename;
|
||||
|
||||
// Storage::disk(config('filesystems.default'))->makeDirectory($path, 0775);
|
||||
|
||||
Storage::disk(config('filesystems.default'))->put($file_path, $html);
|
||||
|
||||
// if (Storage::disk(config('filesystems.default'))->exists($file_path)) {
|
||||
$this->html_backup = '';
|
||||
$this->filename = $file_path;
|
||||
$this->save();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public function deleteFile()
|
||||
|
@ -60,7 +60,7 @@ class ActivityRepository extends BaseRepository
|
||||
$activity->save();
|
||||
|
||||
//rate limiter
|
||||
$this->createBackup($entity, $activity);
|
||||
// $this->createBackup($entity, $activity);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,7 +83,6 @@ class ActivityRepository extends BaseRepository
|
||||
$backup = new Backup();
|
||||
$entity->load('client');
|
||||
$contact = $entity->client->primary_contact()->first();
|
||||
$backup->html_backup = '';
|
||||
$backup->amount = $entity->amount;
|
||||
$backup->activity_id = $activity->id;
|
||||
$backup->json_backup = '';
|
||||
|
@ -34,7 +34,7 @@ class InvoiceHistoryTransformer extends EntityTransformer
|
||||
'id' => '',
|
||||
'activity_id' => '',
|
||||
'json_backup' => (string) '',
|
||||
'html_backup' => (string) '',
|
||||
'html_backup' => (string) '', //deprecated
|
||||
'amount' => (float) 0,
|
||||
'created_at' => (int) 0,
|
||||
'updated_at' => (int) 0,
|
||||
@ -45,7 +45,7 @@ class InvoiceHistoryTransformer extends EntityTransformer
|
||||
'id' => $this->encodePrimaryKey($backup->id),
|
||||
'activity_id' => $this->encodePrimaryKey($backup->activity_id),
|
||||
'json_backup' => (string) '',
|
||||
'html_backup' => (string) '',
|
||||
'html_backup' => (string) '', //deprecated
|
||||
'amount' => (float) $backup->amount,
|
||||
'created_at' => (int) $backup->created_at,
|
||||
'updated_at' => (int) $backup->updated_at,
|
||||
|
Loading…
x
Reference in New Issue
Block a user