Skip to content

Commit

Permalink
Fix OAuth1 database migration (#10233)
Browse files Browse the repository at this point in the history
* Fix database migration for removing OAuth1 tables

* Add DB table prefix to migration

* Fix CS

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
  • Loading branch information
dennisameling and RCheesley committed Jul 9, 2021
1 parent ae7d8ca commit 5213e32
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions app/migrations/Version20210609191822.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,22 @@

final class Version20210609191822 extends AbstractMauticMigration
{
private $tables = [
'oauth1_access_tokens',
'oauth1_consumers',
'oauth1_nonces',
'oauth1_request_tokens',
];

/**
* Mautic 4 removed OAuth1 support, so we drop those tables.
* Mautic 4 removed OAuth1 support, so we drop those tables if they exist.
*/
public function up(Schema $schema): void
{
$schema->dropTable('oauth1_access_tokens');
$schema->dropTable('oauth1_consumers');
$schema->dropTable('oauth1_nonces');
$schema->dropTable('oauth1_request_tokens');
foreach ($this->tables as $table) {
if ($schema->hasTable($this->prefix.$table)) {
$schema->dropTable($this->prefix.$table);
}
}
}
}

0 comments on commit 5213e32

Please sign in to comment.