diff --git a/lacommunaute/forum_conversation/migrations/0009_run_management.py b/lacommunaute/forum_conversation/migrations/0009_run_management.py new file mode 100644 index 000000000..56dc2af05 --- /dev/null +++ b/lacommunaute/forum_conversation/migrations/0009_run_management.py @@ -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, + ), + ] diff --git a/lacommunaute/users/migrations/0008_run_management.py b/lacommunaute/users/migrations/0008_run_management.py new file mode 100644 index 000000000..b1829f764 --- /dev/null +++ b/lacommunaute/users/migrations/0008_run_management.py @@ -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, + ), + ]