mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
Remove hg updates and projects in migration
This commit is contained in:
parent
64fa18cafe
commit
590d64f40e
@ -1,6 +1,5 @@
|
||||
# Generated by Django 2.2.16 on 2020-12-01 18:50
|
||||
|
||||
from django.db import migrations, models
|
||||
from awx.main.migrations._hg_removal import delete_hg_scm
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -10,6 +9,7 @@ class Migration(migrations.Migration):
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(delete_hg_scm),
|
||||
migrations.AlterField(
|
||||
model_name='project',
|
||||
name='scm_type',
|
||||
|
||||
12
awx/main/migrations/_hg_removal.py
Normal file
12
awx/main/migrations/_hg_removal.py
Normal file
@ -0,0 +1,12 @@
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger('awx.main.migrations')
|
||||
|
||||
|
||||
def delete_hg_scm(apps, schema_editor):
|
||||
set_current_apps(apps)
|
||||
Project = apps.get_model('main', 'Project')
|
||||
ProjectUpdate = apps.get_model('main', 'ProjectUpdate')
|
||||
|
||||
ProjectUpdate.objects.filter(project__scm_type='hg').delete()
|
||||
Project.objects.filter(scm_type='hg').delete()
|
||||
Loading…
x
Reference in New Issue
Block a user