Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the column name in the "remember me" migration #6895

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions core-bundle/src/Migration/Version503/RememberMeMigration.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,20 @@ public function run(): MigrationResult
SQL,
);

$schemaManager = $this->connection->createSchemaManager();
$username = isset($schemaManager->listTableColumns('tl_remember_me')['useridentifier']) ? 'userIdentifier' : 'username';

$this->connection->executeStatement(
<<<'SQL'
<<<SQL
INSERT INTO rememberme_token (
SELECT
TRIM(TRAILING CHAR(0) FROM CAST(series AS char)),
TRIM(TRAILING CHAR(0) FROM CAST(value AS char)),
lastUsed,
class,
userIdentifier
$username
FROM tl_remember_me
WHERE userIdentifier != ''
WHERE $username != ''
)
SQL,
);
Expand Down