ysdsad
All checks were successful
Deploy / deploy-staging (push) Successful in 25s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-08-14 02:13:02 +02:00
parent 3205d9f0f6
commit 8bcd445759
2 changed files with 42 additions and 4 deletions

View File

@@ -279,6 +279,7 @@ final class SchemaManager
public function upgradeSchemaDirect(): array
{
$before = $this->schemaStatus();
$coreTables = [
$this->prefix . 'projects',
$this->prefix . 'settings',
@@ -291,8 +292,11 @@ final class SchemaManager
$presentCoreTables = $this->existingTables($coreTables);
if ($presentCoreTables === []) {
$this->importSchema();
$after = $this->schemaStatus();
return [
'upgraded' => ['schema_initialized'],
'before' => $before,
'after' => $after,
'message' => 'Mining-Checker Schema wurde neu angelegt.',
];
}
@@ -312,6 +316,19 @@ final class SchemaManager
$this->upgradeCostPlanColumns();
$applied[] = 'cost_plan_columns';
}
if (
($this->tableExists($this->prefix . 'cost_plans') && (
!$this->columnExists($this->prefix . 'cost_plans', 'daily_cost_amount') ||
!$this->columnExists($this->prefix . 'cost_plans', 'daily_cost_currency')
)) ||
($this->tableExists($this->prefix . 'purchased_miners') && (
!$this->columnExists($this->prefix . 'purchased_miners', 'daily_cost_amount') ||
!$this->columnExists($this->prefix . 'purchased_miners', 'daily_cost_currency')
))
) {
$this->upgradeServerDailyCostColumns();
$applied[] = 'server_daily_cost_columns';
}
$settingsColumns = $this->existingColumns($this->prefix . 'settings', ['preferred_currencies', 'report_currency', 'crypto_currency', 'display_timezone', 'fx_max_age_hours', 'module_theme_mode', 'module_theme_accent']);
if (!in_array('preferred_currencies', $settingsColumns, true) || !in_array('report_currency', $settingsColumns, true) || !in_array('crypto_currency', $settingsColumns, true) || !in_array('display_timezone', $settingsColumns, true) || !in_array('fx_max_age_hours', $settingsColumns, true) || !in_array('module_theme_mode', $settingsColumns, true) || !in_array('module_theme_accent', $settingsColumns, true)) {
@@ -389,8 +406,12 @@ final class SchemaManager
$applied[] = 'target_offer_foreign_key';
}
$after = $this->schemaStatus();
return [
'upgraded' => $applied,
'before' => $before,
'after' => $after,
'message' => $applied === []
? 'Schema ist bereits auf dem neuesten Stand.'
: 'Direktes Schema-Upgrade erfolgreich ausgefuehrt.',