diff --git a/posthog/migrations/0526_project_name_sync.py b/posthog/migrations/0526_project_name_sync.py new file mode 100644 index 0000000000000..0e8b683032864 --- /dev/null +++ b/posthog/migrations/0526_project_name_sync.py @@ -0,0 +1,19 @@ +# Created manually + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [("posthog", "0525_hog_function_transpiled")] + + operations = [ + migrations.RunSQL( + """ + UPDATE posthog_project AS proj + SET name = team.name + FROM posthog_team AS team + WHERE proj.id = team.project_id AND proj.name != team.name""", + reverse_sql=migrations.RunSQL.noop, + elidable=True, + ), + ] diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt index 85a418de0b4c1..106a9c3303738 100644 --- a/posthog/migrations/max_migration.txt +++ b/posthog/migrations/max_migration.txt @@ -1 +1 @@ -0525_hog_function_transpiled +0526_project_name_sync