2022-04-07 10:51:35 +00:00
|
|
|
# Generated by Django 3.1.14 on 2022-04-07 09:26
|
|
|
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
|
|
|
2022-05-02 13:37:42 +00:00
|
|
|
def migrate_platform_type_to_lower(apps, *args):
|
|
|
|
platform_model = apps.get_model('assets', 'Platform')
|
|
|
|
platforms = platform_model.objects.all()
|
|
|
|
for p in platforms:
|
|
|
|
p.type = p.type.lower()
|
|
|
|
p.save()
|
|
|
|
|
|
|
|
|
2022-04-07 10:51:35 +00:00
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
2022-08-24 08:14:32 +00:00
|
|
|
('assets', '0094_auto_20220402_1736'),
|
2022-04-07 10:51:35 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RenameField(
|
|
|
|
model_name='platform',
|
|
|
|
old_name='base',
|
|
|
|
new_name='type',
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='platform',
|
|
|
|
name='category',
|
2022-08-24 08:14:32 +00:00
|
|
|
field=models.CharField(default='host', max_length=32, verbose_name='Category'),
|
2022-04-07 10:51:35 +00:00
|
|
|
),
|
|
|
|
migrations.AlterField(
|
2022-04-12 09:53:56 +00:00
|
|
|
model_name='platform',
|
2022-04-07 10:51:35 +00:00
|
|
|
name='type',
|
2022-08-24 06:23:42 +00:00
|
|
|
field=models.CharField(default='linux', max_length=32, verbose_name='Type'),
|
2022-04-07 10:51:35 +00:00
|
|
|
),
|
2022-09-23 02:15:07 +00:00
|
|
|
migrations.AddField(
|
|
|
|
model_name='platform',
|
|
|
|
name='domain_enabled',
|
|
|
|
field=models.BooleanField(default=True, verbose_name='Domain enabled'),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='platform',
|
|
|
|
name='su_enabled',
|
|
|
|
field=models.BooleanField(default=False, verbose_name='Su enabled'),
|
|
|
|
),
|
|
|
|
migrations.AddField(
|
|
|
|
model_name='platform',
|
|
|
|
name='su_method',
|
2022-12-07 09:24:30 +00:00
|
|
|
field=models.CharField(blank=True, max_length=32, null=True, verbose_name='Su method'),
|
2022-09-23 02:15:07 +00:00
|
|
|
),
|
2022-05-02 13:37:42 +00:00
|
|
|
migrations.RunPython(migrate_platform_type_to_lower)
|
2022-04-07 10:51:35 +00:00
|
|
|
]
|