wtf
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m0s
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m0s
This commit is contained in:
@@ -19,6 +19,10 @@ final class Version20251114111853 extends AbstractMigration
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
if ($this->isSqlite()) {
|
||||
// SQLite installs get albums from Version20251127235840.
|
||||
return;
|
||||
}
|
||||
// Idempotent guard: if table already exists (from previous migration), skip
|
||||
if ($schema->hasTable('albums')) {
|
||||
return;
|
||||
@@ -31,9 +35,17 @@ final class Version20251114111853 extends AbstractMigration
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
if ($this->isSqlite()) {
|
||||
return;
|
||||
}
|
||||
// Be defensive: only drop the table if it exists
|
||||
if ($schema->hasTable('albums')) {
|
||||
$this->addSql('DROP TABLE albums');
|
||||
}
|
||||
}
|
||||
|
||||
private function isSqlite(): bool
|
||||
{
|
||||
return $this->connection->getDatabasePlatform()->getName() === 'sqlite';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user