fix: [migration:unique_usernames] Table 'users' is specified twice, both as a target and as a separate source

cli-modification-summary
Sami Mokaddem 2022-09-20 11:13:24 +02:00
parent 760badd268
commit f37cea1cad
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ final class UniqueUserNames extends AbstractMigration
{
$table = $this->table('users');
$exists = $table->hasIndexByName('users', 'username');
$this->execute('DELETE FROM users WHERE id NOT IN (SELECT MIN(id) FROM users GROUP BY LOWER(username));');
$this->execute('DELETE FROM users WHERE id NOT IN (SELECT MIN(id) FROM (select * from users) AS u2 GROUP BY LOWER(u2.username));');
if (!$exists) {
$table->addIndex(
[