Skip to content

Commit

Permalink
Remove addUserAuthProviderColumn (#40251)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard67 committed Mar 30, 2023
1 parent 4ed2076 commit 2e91c47
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function update($installer)
$this->updateDatabase();
$this->updateAssets($installer);
$this->clearStatsCache();
$this->addUserAuthProviderColumn();
$this->cleanJoomlaCache();
}

Expand Down Expand Up @@ -1348,36 +1347,4 @@ protected function fixFilenameCasing()
}
}
}

/**
* Add the user Auth Provider Column as it could be present from 3.10 already
*
* @return void
*
* @since 4.1.1
*/
protected function addUserAuthProviderColumn(): void
{
$db = Factory::getContainer()->get('DatabaseDriver');

// Check if the column already exists
$fields = $db->getTableColumns('#__users');

// Column exists, skip
if (isset($fields['authProvider'])) {
return;
}

$query = 'ALTER TABLE ' . $db->quoteName('#__users')
. ' ADD COLUMN ' . $db->quoteName('authProvider') . ' varchar(100) DEFAULT ' . $db->quote('') . ' NOT NULL';

// Add column
try {
$db->setQuery($query)->execute();
} catch (Exception $e) {
echo Text::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '<br>';

return;
}
}
}

0 comments on commit 2e91c47

Please sign in to comment.