Skip to content

Commit 31ee509

Browse files
authored
Combine migration numbers 201-205 into 201 for ease of management (ansible#16008)
* Add new squashed migrations file * Squash migrations related to recent removals
1 parent 222f387 commit 31ee509

6 files changed

+100
-147
lines changed

awx/main/migrations/0201_delete_profile.py

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Generated by Django 4.2.10 on 2024-09-16 10:22
2+
3+
from django.db import migrations, models
4+
5+
from awx.main.migrations._create_system_jobs import delete_clear_tokens_sjt
6+
7+
8+
class Migration(migrations.Migration):
9+
dependencies = [
10+
('main', '0200_template_name_constraint'),
11+
]
12+
13+
operations = [
14+
migrations.DeleteModel(
15+
name='Profile',
16+
),
17+
# Remove SSO app content
18+
# delete all sso application migrations
19+
migrations.RunSQL("DELETE FROM django_migrations WHERE app = 'sso';"),
20+
# delete all sso application content group permissions
21+
migrations.RunSQL(
22+
"DELETE FROM auth_group_permissions "
23+
"WHERE permission_id IN "
24+
"(SELECT id FROM auth_permission WHERE content_type_id in (SELECT id FROM django_content_type WHERE app_label = 'sso'));"
25+
),
26+
# delete all sso application content permissions
27+
migrations.RunSQL("DELETE FROM auth_permission " "WHERE content_type_id IN (SELECT id FROM django_content_type WHERE app_label = 'sso');"),
28+
# delete sso application content type
29+
migrations.RunSQL("DELETE FROM django_content_type WHERE app_label = 'sso';"),
30+
# drop sso application created table
31+
migrations.RunSQL("DROP TABLE IF EXISTS sso_userenterpriseauth;"),
32+
# Alter inventory source source field
33+
migrations.AlterField(
34+
model_name='inventorysource',
35+
name='source',
36+
field=models.CharField(default=None, max_length=32),
37+
),
38+
migrations.AlterField(
39+
model_name='inventoryupdate',
40+
name='source',
41+
field=models.CharField(default=None, max_length=32),
42+
),
43+
# Alter OAuth2Application unique together
44+
migrations.AlterUniqueTogether(
45+
name='oauth2application',
46+
unique_together=None,
47+
),
48+
migrations.RemoveField(
49+
model_name='oauth2application',
50+
name='organization',
51+
),
52+
migrations.RemoveField(
53+
model_name='oauth2application',
54+
name='user',
55+
),
56+
migrations.RemoveField(
57+
model_name='activitystream',
58+
name='o_auth2_access_token',
59+
),
60+
migrations.RemoveField(
61+
model_name='activitystream',
62+
name='o_auth2_application',
63+
),
64+
migrations.DeleteModel(
65+
name='OAuth2AccessToken',
66+
),
67+
migrations.DeleteModel(
68+
name='OAuth2Application',
69+
),
70+
# Delete system token cleanup jobs, because tokens were deleted
71+
migrations.RunPython(delete_clear_tokens_sjt, migrations.RunPython.noop),
72+
migrations.AlterField(
73+
model_name='systemjob',
74+
name='job_type',
75+
field=models.CharField(
76+
blank=True,
77+
choices=[
78+
('cleanup_jobs', 'Remove jobs older than a certain number of days'),
79+
('cleanup_activitystream', 'Remove activity stream entries older than a certain number of days'),
80+
('cleanup_sessions', 'Removes expired browser sessions from the database'),
81+
],
82+
default='',
83+
max_length=32,
84+
),
85+
),
86+
migrations.AlterField(
87+
model_name='systemjobtemplate',
88+
name='job_type',
89+
field=models.CharField(
90+
blank=True,
91+
choices=[
92+
('cleanup_jobs', 'Remove jobs older than a certain number of days'),
93+
('cleanup_activitystream', 'Remove activity stream entries older than a certain number of days'),
94+
('cleanup_sessions', 'Removes expired browser sessions from the database'),
95+
],
96+
default='',
97+
max_length=32,
98+
),
99+
),
100+
]

awx/main/migrations/0202_remove_sso_app_content.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

awx/main/migrations/0203_alter_inventorysource_source_and_more.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

awx/main/migrations/0204_alter_oauth2application_unique_together_and_more.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

awx/main/migrations/0205_delete_token_cleanup_job.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)