mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.8 KiB
61 lines
1.8 KiB
2 years ago
|
# Generated by Django 3.2.14 on 2022-08-17 05:46
|
||
|
|
||
2 years ago
|
from django.db import migrations, models
|
||
2 years ago
|
|
||
|
|
||
2 years ago
|
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'])
|
||
|
|
||
2 years ago
|
|
||
2 years ago
|
class Migration(migrations.Migration):
|
||
2 years ago
|
dependencies = [
|
||
2 years ago
|
('applications', '0024_alter_application_type'),
|
||
2 years ago
|
]
|
||
|
|
||
|
operations = [
|
||
2 years ago
|
migrations.RunPython(migrate_db_oracle_version_to_attrs),
|
||
2 years ago
|
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',
|
||
|
),
|
||
2 years ago
|
migrations.AlterField(
|
||
|
model_name='application',
|
||
|
name='category',
|
||
|
field=models.CharField(max_length=16, verbose_name='Category'),
|
||
|
),
|
||
|
migrations.AlterField(
|
||
|
model_name='application',
|
||
|
name='type',
|
||
|
field=models.CharField(max_length=16, verbose_name='Type'),
|
||
|
),
|
||
2 years ago
|
]
|