Skip to content

Commit

Permalink
Fix migrations when using MariaDB 10.5
Browse files Browse the repository at this point in the history
Fixes #801
  • Loading branch information
pierredup committed May 18, 2023
1 parent be6b336 commit 1172235
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions migrations/Version20201.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ public function up(Schema $schema): void
$this->schema->getTable('user_company')
->addForeignKeyConstraint('users', ['user_id'], ['id']);

$this->schema
->getTable('user_company')
->dropPrimaryKey();

$this->persistChanges();

$this->migrate('users', false);

$this->schema->getTable('user_company')
->dropPrimaryKey();
$this->schema->getTable('user_company')
->setPrimaryKey(['company_id', 'user_id']);

Expand Down

0 comments on commit 1172235

Please sign in to comment.