-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remplacer un nom de domaine expiré dans les données utilisateurs (
#907) ## Description 🎸 Migrations pour remplacer en masse le nom de domaine dans les emails de `User`, `EmailLastSeen` et `Post` (cas des messages anonymes) ## Type de changement 🚧 technique
- Loading branch information
1 parent
95bea05
commit fb886e1
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
lacommunaute/forum_conversation/migrations/0009_run_management.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 5.1.5 on 2025-02-11 14:41 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("forum_conversation", "0008_remove_topic_likers"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
""" | ||
UPDATE forum_conversation_post | ||
SET username = LOWER(username); | ||
""", | ||
elidable=True, | ||
), | ||
migrations.RunSQL( | ||
""" | ||
UPDATE forum_conversation_post | ||
SET username = regexp_replace(username, '@pole-emploi.fr$', '@francetravail.fr') | ||
WHERE username LIKE '%@pole-emploi.fr'; | ||
""", | ||
elidable=True, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 5.1.5 on 2025-02-11 14:37 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("users", "0007_alter_emaillastseen_last_seen_kind"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
""" | ||
UPDATE users_user | ||
SET email = regexp_replace(email, '@pole-emploi.fr$', '@francetravail.fr') | ||
WHERE email LIKE '%@pole-emploi.fr'; | ||
""" | ||
), | ||
migrations.RunSQL( | ||
""" | ||
UPDATE users_emaillastseen | ||
SET email = regexp_replace(email, '@pole-emploi.fr$', '@francetravail.fr') | ||
WHERE email LIKE '%@pole-emploi.fr'; | ||
""", | ||
elidable=True, | ||
), | ||
] |