agendas: change app_label to lingo_agendas (#84519)
gitea/lingo/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-12-10 15:21:39 +01:00
parent e0738d370b
commit 12018c904a
11 changed files with 124 additions and 16 deletions

24
lingo/agendas/apps.py Normal file
View File

@ -0,0 +1,24 @@
# lingo - payment and billing system
# Copyright (C) 2023 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import django.apps
from django.utils.translation import gettext_lazy as _
class AppConfig(django.apps.AppConfig):
name = 'lingo.agendas'
label = 'lingo_agendas'
verbose_name = _('Agendas')

View File

@ -8,6 +8,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = []
replaces = [('agendas', '0001_initial')]
operations = [
migrations.CreateModel(
@ -20,6 +21,9 @@ class Migration(migrations.Migration):
('label', models.CharField(max_length=150, verbose_name='Label')),
('slug', models.SlugField(max_length=160, unique=True, verbose_name='Identifier')),
],
options={
'db_table': 'agendas_agenda',
},
),
migrations.CreateModel(
name='CheckTypeGroup',
@ -33,6 +37,7 @@ class Migration(migrations.Migration):
],
options={
'ordering': ['label'],
'db_table': 'agendas_checktypegroup',
},
),
migrations.CreateModel(
@ -76,13 +81,14 @@ class Migration(migrations.Migration):
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name='check_types',
to='agendas.checktypegroup',
to='lingo_agendas.checktypegroup',
),
),
],
options={
'ordering': ['label'],
'unique_together': {('group', 'slug')},
'db_table': 'agendas_checktype',
},
),
]

View File

@ -3,8 +3,9 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agendas', '0001_initial'),
('lingo_agendas', '0001_initial'),
]
replaces = [('agendas', '0002_agenda')]
operations = [
migrations.AddField(

View File

@ -4,8 +4,9 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agendas', '0002_agenda'),
('lingo_agendas', '0002_agenda'),
]
replaces = [('agendas', '0003_check_type_group')]
operations = [
migrations.AddField(
@ -15,7 +16,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to='agendas.CheckTypeGroup',
to='lingo_agendas.CheckTypeGroup',
verbose_name='Check type group',
),
),

View File

@ -5,8 +5,9 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('invoicing', '0001_initial'),
('agendas', '0003_check_type_group'),
('lingo_agendas', '0003_check_type_group'),
]
replaces = [('agendas', '0004_regie')]
operations = [
migrations.AddField(

View File

@ -3,13 +3,14 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agendas', '0004_regie'),
('lingo_agendas', '0004_regie'),
]
replaces = [('agendas', '0005_partial_bookings')]
operations = [
migrations.AlterModelOptions(
name='agenda',
options={'ordering': ['label']},
options={'ordering': ['label'], 'db_table': 'agendas_agenda'},
),
migrations.AddField(
model_name='agenda',

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.16 on 2023-12-10 13:27
from django.db import migrations
def forwards(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
ContentType.objects.filter(app_label='agendas').update(app_label='lingo_agendas')
class Migration(migrations.Migration):
dependencies = [
('lingo_agendas', '0005_partial_bookings'),
]
operations = [
migrations.RunPython(forwards, reverse_code=migrations.RunPython.noop),
]

View File

@ -0,0 +1,56 @@
# Generated by Django 3.2.16 on 2023-12-10 13:44
from django.db import migrations
sequences = ['agendas_agenda_id_seq', 'agendas_checktype_id_seq', 'agendas_checktypegroup_id_seq']
indexes = [
'agendas_agenda_pkey',
'agendas_agenda_category_slug_a53608f4',
'agendas_agenda_category_slug_a53608f4_like',
'agendas_agenda_check_type_group_id_44a071bb',
'agendas_agenda_regie_id_632978fa',
'agendas_agenda_slug_9271fa33_like',
'agendas_agenda_slug_key',
]
class Migration(migrations.Migration):
dependencies = [
('lingo_agendas', '0006_rename_app_label'),
('pricing', '0009_agenda_pricing_m2m'),
('invoicing', '0021_campaign_agendas'),
]
operations = [
migrations.AlterModelTable(
name='agenda',
table=None,
),
migrations.AlterModelTable(
name='checktype',
table=None,
),
migrations.AlterModelTable(
name='checktypegroup',
table=None,
),
migrations.RunSQL(
sql='\n'.join(
[f'ALTER SEQUENCE {x} RENAME TO lingo_{x};' for x in sequences]
+ [f'ALTER INDEX {x} RENAME TO lingo_{x};' for x in indexes]
+ [
'ALTER TABLE IF EXISTS invoicing_campaign_lingo_agendas RENAME TO invoicing_campaign_agendas;'
]
+ [
'ALTER TABLE IF EXISTS pricing_agendapricing_lingo_agendas RENAME TO pricing_agendapricing_agendas;'
]
),
reverse_sql='\n'.join(
[f'ALTER SEQUENCE lingo_{x} RENAME TO {x};' for x in sequences]
+ [f'ALTER INDEX lingo_{x} RENAME TO {x};' for x in indexes]
),
),
]
tables = ['invoicing_campaign_lingo_agendas', 'pricing_agendapricing_agendas']

View File

@ -3,14 +3,14 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agendas', '0004_regie'),
('lingo_agendas', '0004_regie'),
('invoicing', '0020_campaign_label'),
]
operations = [
migrations.AddField(
model_name='campaign',
name='agendas',
field=models.ManyToManyField(related_name='campaigns', to='agendas.Agenda'),
name='lingo_agendas',
field=models.ManyToManyField(related_name='campaigns', to='lingo_agendas.Agenda'),
),
]

View File

@ -6,7 +6,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('agendas', '0001_initial'),
('lingo_agendas', '0001_initial'),
('pricing', '0001_initial'),
]
@ -115,7 +115,7 @@ class Migration(migrations.Migration):
('pricing_data', models.JSONField(null=True)),
(
'agenda',
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='agendas.Agenda'),
models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='lingo_agendas.Agenda'),
),
(
'pricing',

View File

@ -4,15 +4,15 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agendas', '0003_check_type_group'),
('lingo_agendas', '0003_check_type_group'),
('pricing', '0004_criteria_default'),
]
operations = [
migrations.AddField(
model_name='agendapricing',
name='agendas',
field=models.ManyToManyField(to='agendas.Agenda', related_name='agendapricings'),
name='lingo_agendas',
field=models.ManyToManyField(to='lingo_agendas.Agenda', related_name='agendapricings'),
),
migrations.AlterField(
model_name='agendapricing',
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name='old_agendapricings',
to='agendas.Agenda',
to='lingo_agendas.Agenda',
),
),
]