jumpserver/apps/applications/migrations/0022_auto_20220817_1346.py

51 lines
1.4 KiB
Python
Raw Normal View History

2022-08-17 07:44:59 +00:00
# Generated by Django 3.2.14 on 2022-08-17 05:46
from django.db import migrations
2022-08-30 04:50:01 +00:00
def migrate_db_oracle_version_to_attrs(apps, schema_editor):
db_alias = schema_editor.connection.alias
model = apps.get_model("applications", "Application")
oracles = list(model.objects.using(db_alias).filter(type='oracle'))
for o in oracles:
o.attrs['version'] = '12c'
model.objects.using(db_alias).bulk_update(oracles, ['attrs'])
2022-08-17 07:44:59 +00:00
2022-08-30 04:50:01 +00:00
class Migration(migrations.Migration):
2022-08-17 07:44:59 +00:00
dependencies = [
2022-08-18 03:15:17 +00:00
('applications', '0021_auto_20220629_1826'),
2022-08-17 07:44:59 +00:00
]
operations = [
2022-08-30 04:50:01 +00:00
migrations.RunPython(migrate_db_oracle_version_to_attrs),
2022-08-17 07:44:59 +00:00
migrations.AlterUniqueTogether(
name='account',
unique_together=None,
),
migrations.RemoveField(
model_name='account',
name='app',
),
migrations.RemoveField(
model_name='account',
name='systemuser',
),
migrations.RemoveField(
model_name='application',
name='domain',
),
migrations.RemoveField(
model_name='historicalaccount',
name='app',
),
migrations.RemoveField(
model_name='historicalaccount',
name='history_user',
),
migrations.RemoveField(
model_name='historicalaccount',
name='systemuser',
),
]