Skip to content

Commit

Permalink
in case a table does not exist yet we might add it at a later migration
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Aug 31, 2024
1 parent f1ee792 commit b05dfde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Migrations/Version20240121100724.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ public function up(Schema $schema): void
}

foreach (Tenant::TENANT_TABLES as $tableName) {
if (!$schema->hasTable($tableName)) {
continue;
}

$table = $schema->getTable($tableName);
if (!$table->hasColumn('tenant_id')) {
$table->addColumn('tenant_id', 'string', ['length' => 64, 'notnull' => false, 'default' => null]);
Expand Down

0 comments on commit b05dfde

Please sign in to comment.