dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbx\dbxAdmin\dbxDatabaseMigrationService Class Reference

Engine-unabhaengiger, DD-basierter Datenbank-Migrationsrunner. More...

Public Member Functions

 __construct (?object $db=null, ?object $dd=null)
 discover (string $releaseRoot, string $targetVersion='')
 plan (string $releaseRoot, string $targetVersion)
 prepare (string $releaseRoot, string $targetVersion, string $backupDirectory)
 Erstellt konsistente Tabellenbackups fuer alle ausstehenden Migrationen.
 apply (array $state)
 rollback (array $state)
 Stellt Schema und Daten aller vorbereiteten Tabellen wieder her.

Public Attributes

const LEDGER_DD = 'dbxAdmin|dbxMigration'

Detailed Description

Engine-unabhaengiger, DD-basierter Datenbank-Migrationsrunner.

Migrationen duerfen Daten nur ueber das uebergebene dbxDB/dbxDD-Objekt bearbeiten. Der Runner loest fuer jede DD ihre lokale Serverbindung auf, sichert betroffene Tabellen und protokolliert jede Migrations-ID.

Definition at line 17 of file dbxDatabaseMigrationService.class.php.

Constructor & Destructor Documentation

◆ __construct()

dbx\dbxAdmin\dbxDatabaseMigrationService::__construct ( ?object $db = null,
?object $dd = null )

Definition at line 24 of file dbxDatabaseMigrationService.class.php.

Member Function Documentation

◆ apply()

dbx\dbxAdmin\dbxDatabaseMigrationService::apply ( array $state)

Definition at line 366 of file dbxDatabaseMigrationService.class.php.

References $applied, $expected, $migration, $state, and discover().

◆ discover()

dbx\dbxAdmin\dbxDatabaseMigrationService::discover ( string $releaseRoot,
string $targetVersion = '' )
Returns
array<string,array<string,mixed>>

Definition at line 36 of file dbxDatabaseMigrationService.class.php.

References $file, $migrationFile, $root, and $version.

Referenced by apply(), and plan().

◆ plan()

dbx\dbxAdmin\dbxDatabaseMigrationService::plan ( string $releaseRoot,
string $targetVersion )
Returns
array{migrations:array,pending:array,applied:array}

Definition at line 137 of file dbxDatabaseMigrationService.class.php.

References $applied, $ledger, $migration, and discover().

Referenced by prepare().

◆ prepare()

dbx\dbxAdmin\dbxDatabaseMigrationService::prepare ( string $releaseRoot,
string $targetVersion,
string $backupDirectory )

Erstellt konsistente Tabellenbackups fuer alle ausstehenden Migrationen.

Returns
array<string,mixed>

Definition at line 170 of file dbxDatabaseMigrationService.class.php.

References $plan, $root, and plan().

◆ rollback()

dbx\dbxAdmin\dbxDatabaseMigrationService::rollback ( array $state)

Stellt Schema und Daten aller vorbereiteten Tabellen wieder her.

Definition at line 679 of file dbxDatabaseMigrationService.class.php.

References $server, $state, and $table.

Member Data Documentation

◆ LEDGER_DD

const dbx\dbxAdmin\dbxDatabaseMigrationService::LEDGER_DD = 'dbxAdmin|dbxMigration'

The documentation for this class was generated from the following file: