This commit is contained in:
Andras Bacsai 2023-10-13 16:32:59 +02:00
parent d635e5dbae
commit d2d1f984e1
2 changed files with 6 additions and 3 deletions

View File

@ -64,7 +64,6 @@ public function new()
} else if ($type->value() === 'redis') { } else if ($type->value() === 'redis') {
$database = create_standalone_redis($environment->id, $destination_uuid); $database = create_standalone_redis($environment->id, $destination_uuid);
} }
ray($database);
return redirect()->route('project.database.configuration', [ return redirect()->route('project.database.configuration', [
'project_uuid' => $project->uuid, 'project_uuid' => $project->uuid,
'environment_name' => $environment->name, 'environment_name' => $environment->name,

View File

@ -32,7 +32,7 @@ public function submit(): void
$this->emit('error', 'Invalid Cron / Human expression.'); $this->emit('error', 'Invalid Cron / Human expression.');
return; return;
} }
ScheduledDatabaseBackup::create([ $payload = [
'enabled' => true, 'enabled' => true,
'frequency' => $this->frequency, 'frequency' => $this->frequency,
'save_s3' => $this->save_s3, 'save_s3' => $this->save_s3,
@ -40,7 +40,11 @@ public function submit(): void
'database_id' => $this->database->id, 'database_id' => $this->database->id,
'database_type' => $this->database->getMorphClass(), 'database_type' => $this->database->getMorphClass(),
'team_id' => currentTeam()->id, 'team_id' => currentTeam()->id,
]); ];
if ($this->database->type() === 'standalone-postgresql') {
$payload['databases_to_backup'] = $this->database->postgres_db;
}
ScheduledDatabaseBackup::create($payload);
$this->emit('refreshScheduledBackups'); $this->emit('refreshScheduledBackups');
} catch (\Throwable $e) { } catch (\Throwable $e) {
handleError($e, $this); handleError($e, $this);