mirror of https://github.com/jumpserver/jumpserver
Michael Bai
3 years ago
committed by
老广
2 changed files with 28 additions and 1 deletions
@ -0,0 +1,27 @@ |
|||||||
|
# Generated by Django 3.1.13 on 2021-12-15 06:36 |
||||||
|
|
||||||
|
from django.db import migrations, models |
||||||
|
|
||||||
|
OLD_ACTION_ALLOW = 1 |
||||||
|
NEW_ACTION_ALLOW = 9 |
||||||
|
|
||||||
|
|
||||||
|
def migrate_action(apps, schema_editor): |
||||||
|
model = apps.get_model("assets", "CommandFilterRule") |
||||||
|
model.objects.filter(action=OLD_ACTION_ALLOW).update(action=NEW_ACTION_ALLOW) |
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration): |
||||||
|
|
||||||
|
dependencies = [ |
||||||
|
('assets', '0082_auto_20211209_1440'), |
||||||
|
] |
||||||
|
|
||||||
|
operations = [ |
||||||
|
migrations.RunPython(migrate_action), |
||||||
|
migrations.AlterField( |
||||||
|
model_name='commandfilterrule', |
||||||
|
name='action', |
||||||
|
field=models.IntegerField(choices=[(0, 'Deny'), (9, 'Allow'), (2, 'Reconfirm')], default=0, verbose_name='Action'), |
||||||
|
), |
||||||
|
] |
Loading…
Reference in new issue