feat:backup und restore der contao Datenbank über sql file

This commit is contained in:
Robert Wartenberg committed 2026-08-18 17:24:12 +02:00
1 parent 1c1bf84b7a
commit e44b16e523
6 files changed
+237 -1

No files matched your search

@@ -0,0 +1,39 @@
$projectRoot = Split-Path -Parent $PSScriptRoot
$seedPath = Join-Path $projectRoot 'database\contao-baseline.sql'
$exportScriptPath = Join-Path $projectRoot 'scripts\Export-ContaoBaseline.ps1'
$importScriptPath = Join-Path $projectRoot 'scripts\Import-ContaoBaseline.ps1'
Describe 'Contao baseline' {
$seed = Get-Content -LiteralPath $seedPath -Raw
It 'contains the page-specific PerspektivWerk background rule' {
$seed | Should Match 'body\.perspektivwerk-page \{ background-color: #159A34; \}'
}
It 'contains the versioned Contao website tables' {
foreach ($table in @('tl_theme', 'tl_layout', 'tl_page', 'tl_article', 'tl_content')) {
$seed | Should Match "INSERT INTO ``$table``"
}
}
It 'does not contain user, runtime or unversioned file metadata' {
$seed | Should Not Match 'INSERT INTO `tl_(user|session|log|lock|files)'
}
It 'uses the same approved table list in export and import scripts' {
$export = Get-Content -LiteralPath $exportScriptPath -Raw
$import = Get-Content -LiteralPath $importScriptPath -Raw
foreach ($table in @('tl_theme', 'tl_layout', 'tl_module', 'tl_page', 'tl_article', 'tl_content', 'tl_form', 'tl_form_field')) {
$export | Should Match $table
$import | Should Match $table
}
}
It 'asks before overwriting an existing baseline export' {
$export = Get-Content -LiteralPath $exportScriptPath -Raw
$export | Should Match 'Read-Host'
$export | Should Match 'überschreiben'
}
}