mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-06 14:07:37 -04:00
Allow single-database PostgreSQL imports to drop matching objects before restore. The API and import form accept replace_existing, which adds --clean --if-exists to pg_restore, and pg_restore now uses --exit-on-error.
19 lines
883 B
PHP
19 lines
883 B
PHP
<?php
|
|
|
|
test('documents standalone and service database import endpoints', function () {
|
|
$document = json_decode(file_get_contents(__DIR__.'/../../openapi.json'), true, flags: JSON_THROW_ON_ERROR);
|
|
|
|
expect($document['paths'])
|
|
->toHaveKey('/databases/{uuid}/imports/uploads')
|
|
->toHaveKey('/databases/{uuid}/imports')
|
|
->toHaveKey('/databases/{uuid}/imports/{activity_id}')
|
|
->toHaveKey('/services/{uuid}/databases/{database_uuid}/imports/uploads')
|
|
->toHaveKey('/services/{uuid}/databases/{database_uuid}/imports')
|
|
->toHaveKey('/services/{uuid}/databases/{database_uuid}/imports/{activity_id}');
|
|
|
|
foreach ($document['components']['schemas']['DatabaseImportRequest']['oneOf'] as $source) {
|
|
expect($source['properties']['replace_existing'])
|
|
->toMatchArray(['type' => 'boolean', 'default' => false]);
|
|
}
|
|
});
|