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

This commit is contained in:
2026-05-05 20:36:41 +02:00
parent fd092ef615
commit eb8b04a621
14 changed files with 39 additions and 969 deletions

View File

@@ -213,18 +213,6 @@ final class SchemaManager
$this->upgradeTargetOfferColumn();
$applied[] = 'target_offer_column';
}
if (!$this->tableExists($this->prefix . 'currency_aliases')) {
$this->ensureCurrencyAliasesTable();
$applied[] = 'currency_aliases_table';
}
if ($this->tableExists($this->prefix . 'currencies') && !$this->columnExists($this->prefix . 'currencies', 'is_crypto')) {
$this->upgradeCurrenciesClassificationColumns();
$applied[] = 'currency_classification';
}
if ($this->tableExists($this->prefix . 'currencies')) {
$this->ensureCurrencyForeignKeys();
$applied[] = 'currency_foreign_keys';
}
if ($this->tableExists($this->prefix . 'miner_offers') && (
!$this->columnExists($this->prefix . 'miner_offers', 'base_price_amount') ||
!$this->columnExists($this->prefix . 'miner_offers', 'base_price_currency') ||
@@ -264,7 +252,6 @@ final class SchemaManager
{
$coreTables = [
$this->prefix . 'projects',
$this->prefix . 'currencies',
$this->prefix . 'settings',
$this->prefix . 'cost_plans',
$this->prefix . 'measurements',
@@ -335,18 +322,6 @@ final class SchemaManager
$this->upgradeTargetOfferColumn();
$applied[] = 'target_offer_column';
}
if (!$this->tableExists($this->prefix . 'currency_aliases')) {
$this->ensureCurrencyAliasesTable();
$applied[] = 'currency_aliases_table';
}
if ($this->tableExists($this->prefix . 'currencies') && !$this->columnExists($this->prefix . 'currencies', 'is_crypto')) {
$this->upgradeCurrenciesClassificationColumns();
$applied[] = 'currency_classification';
}
if ($this->tableExists($this->prefix . 'currencies')) {
$this->ensureCurrencyForeignKeys();
$applied[] = 'currency_foreign_keys';
}
if ($this->tableExists($this->prefix . 'miner_offers') && (
!$this->columnExists($this->prefix . 'miner_offers', 'base_price_amount') ||
!$this->columnExists($this->prefix . 'miner_offers', 'base_price_currency') ||
@@ -788,36 +763,6 @@ final class SchemaManager
$this->ensureMeasurementRatesTable();
$this->ensurePayoutsTable();
$this->ensureMinerTables();
$this->ensureCurrencyAliasesTable();
}
public function ensureCurrencyAliasesTable(): void
{
if ($this->tableExists($this->prefix . 'currency_aliases')) {
return;
}
$table = $this->prefix . 'currency_aliases';
$currencyTable = $this->prefix . 'currencies';
$statements = $this->driver === 'pgsql'
? [
'CREATE TABLE IF NOT EXISTS ' . $table . ' (
alias_code VARCHAR(10) PRIMARY KEY,
currency_code VARCHAR(10) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT fk_mining_currency_aliases_currency FOREIGN KEY (currency_code) REFERENCES ' . $currencyTable . '(code) ON DELETE CASCADE
)',
]
: [
'CREATE TABLE IF NOT EXISTS `' . $table . '` (
alias_code VARCHAR(10) NOT NULL PRIMARY KEY,
currency_code VARCHAR(10) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT fk_mining_currency_aliases_currency FOREIGN KEY (currency_code) REFERENCES `' . $currencyTable . '`(code) ON DELETE CASCADE
)',
];
$this->executeUpgradeStatements($statements, 'Schema-Upgrade fuer Waehrungs-Aliase fehlgeschlagen.');
}
public function ensureMeasurementRatesTable(): void
@@ -1361,7 +1306,6 @@ final class SchemaManager
{
return [
$this->prefix . 'projects',
$this->prefix . 'currencies',
$this->prefix . 'settings',
$this->prefix . 'cost_plans',
$this->prefix . 'measurements',
@@ -1379,7 +1323,6 @@ final class SchemaManager
$this->prefix . 'payouts',
$this->prefix . 'miner_offers',
$this->prefix . 'purchased_miners',
$this->prefix . 'currency_aliases',
];
}
@@ -1392,8 +1335,6 @@ final class SchemaManager
{
return [
$this->prefix . 'projects',
$this->prefix . 'currencies',
$this->prefix . 'currency_aliases',
$this->prefix . 'settings',
$this->prefix . 'cost_plans',
$this->prefix . 'measurements',