Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(database): align restore confirmation copy with replace-existing behavior

Andras Bacsai5a3d0002f822
diff --git a/resources/views/livewire/project/database/import-form.blade.php b/resources/views/livewire/project/database/import-form.blade.php
index 4dd771ac7e..03cc780e52 100644
--- a/resources/views/livewire/project/database/import-form.blade.php
+++ b/resources/views/livewire/project/database/import-form.blade.php
@@ -191,7 +191,7 @@
<li>Copy backup file to database container</li>
<li>Execute restore command</li>
</ul>
- <p class="pt-2 font-semibold text-error">All existing data will be replaced.</p>
+ <p class="pt-2 font-semibold text-error">Existing objects can cause the import to fail unless replacement is enabled.</p>
</x-modal-confirmation>
</div>
</div>
@@ -251,7 +251,7 @@
<li>Copy file into database container</li>
<li>Execute restore command</li>
</ul>
- <p class="pt-2 font-semibold text-error">All existing data will be replaced.</p>
+ <p class="pt-2 font-semibold text-error">Existing objects can cause the import to fail unless replacement is enabled.</p>
</x-modal-confirmation>
</div>
</div>
diff --git a/tests/Feature/DatabaseRestoreDialogTest.php b/tests/Feature/DatabaseRestoreDialogTest.php
index 5989543cf1..f373afe6e2 100644
--- a/tests/Feature/DatabaseRestoreDialogTest.php
+++ b/tests/Feature/DatabaseRestoreDialogTest.php
@@ -27,3 +27,13 @@ test('postgresql single database restore offers explicit object replacement', fu
->toContain('wire:model="postgresqlRestoreCommand"')
->toContain('label="Import command" readonly');
});
+
+test('restore confirmation dialogs warn that existing objects can block the import', function () {
+ $view = file_get_contents(resource_path('views/livewire/project/database/import-form.blade.php'));
+
+ expect($view)
+ ->toContain('submitAction="runImport"')
+ ->toContain('submitAction="restoreFromS3"')
+ ->toContain('Existing objects can cause the import to fail unless replacement is enabled.')
+ ->not->toContain('All existing data will be replaced.');
+});