mirror of https://github.com/interlegis/sigi.git
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.
32 lines
865 B
32 lines
865 B
# Generated by Django 6.0.4 on 2026-08-12 14:30
|
|
|
|
from django.db import migrations
|
|
|
|
SIGLA_X_RANCHER = (
|
|
("GOVBR", "GOV.BR"),
|
|
("LEGBR", "LEG.BR"),
|
|
("DNSREV", "DNS reverso"),
|
|
)
|
|
|
|
|
|
def update_registros(apps, schema_editor):
|
|
TipoServico = apps.get_model("servicos", "TipoServico")
|
|
for sigla, tipo_rancher in SIGLA_X_RANCHER:
|
|
TipoServico.objects.filter(sigla=sigla).update(
|
|
tipo_rancher=tipo_rancher
|
|
)
|
|
|
|
|
|
def reverse_registros(apps, schema_editor):
|
|
TipoServico = apps.get_model("servicos", "TipoServico")
|
|
for sigla, tipo_rancher in SIGLA_X_RANCHER:
|
|
TipoServico.objects.filter(sigla=sigla).update(tipo_rancher="")
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("servicos", "0024_auto_20260807_1218"),
|
|
]
|
|
|
|
operations = [migrations.RunPython(update_registros, reverse_registros)]
|
|
|