Skip to content

Commit

Permalink
Inc db-mig
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Jan 21, 2025
1 parent d1e7c55 commit 564ccdc
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
38 changes: 0 additions & 38 deletions dojo/db_migrations/0219_system_settings_disclaimer_notif.py

This file was deleted.

37 changes: 27 additions & 10 deletions dojo/db_migrations/0220_system_settings_disclaimer_notif.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
# Generated by Django 5.0.8 on 2024-09-12 18:22

from django.db import migrations


def copy_notif_field(apps, schema_editor):
system_settings_model = apps.get_model('dojo', 'System_Settings').objects.get()
if system_settings_model.disclaimer_notifications:
system_settings_model.disclaimer_reports = system_settings_model.disclaimer_notifications
system_settings_model.save()
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('dojo', '0219_system_settings_disclaimer_notif'),
('dojo', '0219_system_settings_enforce_verified_status_jira_and_more'),
]

operations = [
migrations.RunPython(copy_notif_field, reverse_code=migrations.RunPython.noop),
migrations.RenameField(
model_name='system_settings',
old_name='disclaimer',
new_name='disclaimer_notifications',
),
migrations.AlterField(
model_name='system_settings',
name='disclaimer_notifications',
field=models.TextField(blank=True, default='', help_text='Include this custom disclaimer on all notifications', max_length=3000, verbose_name='Custom Disclaimer for Notifications'),
),
migrations.AddField(
model_name='system_settings',
name='disclaimer_reports',
field=models.TextField(blank=True, default='', help_text='Include this custom disclaimer on generated reports', max_length=5000, verbose_name='Custom Disclaimer for Reports'),
),
migrations.AddField(
model_name='system_settings',
name='disclaimer_notes',
field=models.TextField(blank=True, default='', help_text='Include this custom disclaimer next to input form for notes', max_length=3000, verbose_name='Custom Disclaimer for Notes'),
),
migrations.AddField(
model_name='system_settings',
name='disclaimer_reports_forced',
field=models.BooleanField(default=False, help_text="Disclaimer will be added to all reports even if user didn't selected 'Include disclaimer'.", verbose_name='Force to add disclaimer reports'),
),
]
21 changes: 21 additions & 0 deletions dojo/db_migrations/0221_system_settings_disclaimer_notif.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 5.0.8 on 2024-09-12 18:22

from django.db import migrations


def copy_notif_field(apps, schema_editor):
system_settings_model = apps.get_model('dojo', 'System_Settings').objects.get()
if system_settings_model.disclaimer_notifications:
system_settings_model.disclaimer_reports = system_settings_model.disclaimer_notifications
system_settings_model.save()


class Migration(migrations.Migration):

dependencies = [
('dojo', '0220_system_settings_disclaimer_notif'),
]

operations = [
migrations.RunPython(copy_notif_field, reverse_code=migrations.RunPython.noop),
]

0 comments on commit 564ccdc

Please sign in to comment.