Skip to content

Commit 45cc8bb

Browse files
Update migrations/MANUAL-fix-usernames-6b042b.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 322f266 commit 45cc8bb

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

migrations/MANUAL-fix-usernames-6b042b.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ def upgrade(self, session):
3434
expression = """
3535
UPDATE iam_users
3636
SET
37-
email = CASE
38-
WHEN email IS NULL THEN name
39-
ELSE email
40-
END,
37+
email = COALESCE(email, name),
4138
name = SUBSTRING(name, 1, POSITION('@' IN name) - 1)
4239
WHERE name LIKE '%@%';
4340
"""

0 commit comments

Comments
 (0)