chore: squash migrations

reduces the amount required

ref: #702
This commit is contained in:
2025-04-10 12:05:43 +09:30
parent 32251d0a08
commit 32d97932d1
11 changed files with 142 additions and 264 deletions

View File

@ -1,34 +0,0 @@
# Generated by Django 5.1.5 on 2025-04-03 03:38
import access.fields
import access.models.tenancy
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0004_organizationhistory_teamhistory'),
]
operations = [
migrations.CreateModel(
name='Entity',
fields=[
('is_global', models.BooleanField(default=False, help_text='Is this a global object?', verbose_name='Global Object')),
('model_notes', models.TextField(blank=True, default=None, help_text='Tid bits of information', null=True, verbose_name='Notes')),
('id', models.AutoField(help_text='Primary key of the entry', primary_key=True, serialize=False, unique=True, verbose_name='ID')),
('entity_type', models.CharField(default='entity', help_text='Type this entity is', max_length=30, verbose_name='Entity Type')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of creation', verbose_name='Created')),
('modified', access.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of last modification', verbose_name='Modified')),
('organization', models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists], verbose_name='Organization')),
],
options={
'verbose_name': 'Entity',
'verbose_name_plural': 'Entities',
'ordering': ['created', 'modified', 'organization'],
},
),
]

View File

@ -0,0 +1,140 @@
# Generated by Django 5.2 on 2025-04-10 02:34
import access.fields
import access.models.tenancy
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0004_organizationhistory_teamhistory'),
('auth', '0012_alter_user_first_name_max_length'),
('core', '0021_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.CreateModel(
name='Entity',
fields=[
('is_global', models.BooleanField(default=False, help_text='Is this a global object?', verbose_name='Global Object')),
('model_notes', models.TextField(blank=True, default=None, help_text='Tid bits of information', null=True, verbose_name='Notes')),
('id', models.AutoField(help_text='Primary key of the entry', primary_key=True, serialize=False, unique=True, verbose_name='ID')),
('entity_type', models.CharField(default='entity', help_text='Type this entity is', max_length=30, verbose_name='Entity Type')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of creation', verbose_name='Created')),
('modified', access.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of last modification', verbose_name='Modified')),
('organization', models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists], verbose_name='Organization')),
],
options={
'verbose_name': 'Entity',
'verbose_name_plural': 'Entities',
'ordering': ['created', 'modified', 'organization'],
},
),
migrations.CreateModel(
name='Person',
fields=[
('entity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='access.entity')),
('f_name', models.CharField(help_text='The persons first name', max_length=64, verbose_name='First Name')),
('m_name', models.CharField(blank=True, default=None, help_text='The persons middle name(s)', max_length=100, null=True, verbose_name='Middle Name(s)')),
('l_name', models.CharField(help_text='The persons Last name', max_length=64, verbose_name='Last Name')),
('dob', models.DateField(blank=True, default=None, help_text='The Persons Date of Birth (DOB)', null=True, verbose_name='DOB')),
],
options={
'verbose_name': 'Person',
'verbose_name_plural': 'People',
'ordering': ['l_name', 'm_name', 'f_name', 'dob'],
},
bases=('access.entity',),
),
migrations.CreateModel(
name='EntityHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='access.entity', verbose_name='Model')),
],
options={
'verbose_name': 'Entity History',
'verbose_name_plural': 'Entity History',
'db_table': 'access_entity_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
migrations.CreateModel(
name='EntityNotes',
fields=[
('modelnotes_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelnotes')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='access.entity', verbose_name='Model')),
],
options={
'verbose_name': 'Entity Note',
'verbose_name_plural': 'Entity Notes',
'db_table': 'access_entity_notes',
'ordering': ['-created'],
},
bases=('core.modelnotes',),
),
migrations.CreateModel(
name='Role',
fields=[
('model_notes', models.TextField(blank=True, default=None, help_text='Tid bits of information', null=True, verbose_name='Notes')),
('id', models.AutoField(help_text='Primary key of the entry', primary_key=True, serialize=False, unique=True, verbose_name='ID')),
('name', models.CharField(help_text='Name of this role', max_length=30, verbose_name='Name')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of creation', verbose_name='Created')),
('modified', access.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of last modification', verbose_name='Modified')),
('organization', models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists], verbose_name='Organization')),
('permissions', models.ManyToManyField(blank=True, help_text='Permissions part of this role', related_name='roles', to='auth.permission', verbose_name='Permissions')),
],
options={
'verbose_name': 'Role',
'verbose_name_plural': 'Roles',
'ordering': ['organization', 'name'],
'unique_together': {('organization', 'name')},
},
),
migrations.CreateModel(
name='RoleHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='access.role', verbose_name='Model')),
],
options={
'verbose_name': 'Role History',
'verbose_name_plural': 'Role History',
'db_table': 'access_role_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
migrations.CreateModel(
name='RoleNotes',
fields=[
('modelnotes_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelnotes')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='access.role', verbose_name='Model')),
],
options={
'verbose_name': 'Role Note',
'verbose_name_plural': 'Role Notes',
'db_table': 'access_role_notes',
'ordering': ['-created'],
},
bases=('core.modelnotes',),
),
migrations.CreateModel(
name='Contact',
fields=[
('person_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='access.person')),
('directory', models.BooleanField(blank=True, default=True, help_text='Show contact details in directory', verbose_name='Show in Directory')),
('email', models.EmailField(help_text='E-mail address for this person', max_length=254, unique=True, verbose_name='E-Mail')),
],
options={
'verbose_name': 'Contact',
'verbose_name_plural': 'Contacts',
'ordering': ['email'],
},
bases=('access.person',),
),
]

View File

@ -1,30 +0,0 @@
# Generated by Django 5.1.5 on 2025-04-03 03:39
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0005_entity'),
]
operations = [
migrations.CreateModel(
name='Person',
fields=[
('entity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='access.entity')),
('f_name', models.CharField(help_text='The persons first name', max_length=64, verbose_name='First Name')),
('m_name', models.CharField(blank=True, default=None, help_text='The persons middle name(s)', max_length=100, null=True, verbose_name='Middle Name(s)')),
('l_name', models.CharField(help_text='The persons Last name', max_length=64, verbose_name='Last Name')),
('dob', models.DateField(blank=True, default=None, help_text='The Persons Date of Birth (DOB)', null=True, verbose_name='DOB')),
],
options={
'verbose_name': 'Person',
'verbose_name_plural': 'People',
'ordering': ['l_name', 'm_name', 'f_name', 'dob'],
},
bases=('access.entity',),
),
]

View File

@ -1,28 +0,0 @@
# Generated by Django 5.1.5 on 2025-04-03 03:39
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0006_person'),
]
operations = [
migrations.CreateModel(
name='Contact',
fields=[
('person_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='access.person')),
('directory', models.BooleanField(blank=True, default=True, help_text='Show contact details in directory', verbose_name='Show in Directory')),
('email', models.EmailField(help_text='E-mail address for this person', max_length=254, unique=True, verbose_name='E-Mail')),
],
options={
'verbose_name': 'Contact',
'verbose_name_plural': 'Contacts',
'ordering': ['email'],
},
bases=('access.person',),
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 5.1.5 on 2025-04-03 06:26
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0007_contact'),
('core', '0020_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.CreateModel(
name='EntityHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='access.entity', verbose_name='Model')),
],
options={
'verbose_name': 'Entity History',
'verbose_name_plural': 'Entity History',
'db_table': 'access_entity_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 5.1.5 on 2025-04-03 07:52
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0008_entityhistory'),
('core', '0020_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.CreateModel(
name='EntityNotes',
fields=[
('modelnotes_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelnotes')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='access.entity', verbose_name='Model')),
],
options={
'verbose_name': 'Entity Note',
'verbose_name_plural': 'Entity Notes',
'db_table': 'access_entity_notes',
'ordering': ['-created'],
},
bases=('core.modelnotes',),
),
]

View File

@ -1,36 +0,0 @@
# Generated by Django 5.2 on 2025-04-06 03:49
import access.fields
import access.models.tenancy
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0009_entitynotes'),
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='Role',
fields=[
('model_notes', models.TextField(blank=True, default=None, help_text='Tid bits of information', null=True, verbose_name='Notes')),
('id', models.AutoField(help_text='Primary key of the entry', primary_key=True, serialize=False, unique=True, verbose_name='ID')),
('name', models.CharField(help_text='Name of this role', max_length=30, verbose_name='Name')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of creation', verbose_name='Created')),
('modified', access.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of last modification', verbose_name='Modified')),
('organization', models.ForeignKey(help_text='Organization this belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='access.organization', validators=[access.models.tenancy.TenancyObject.validatate_organization_exists], verbose_name='Organization')),
('permissions', models.ManyToManyField(blank=True, help_text='Permissions part of this role', related_name='roles', to='auth.permission', verbose_name='Permissions')),
],
options={
'verbose_name': 'Role',
'verbose_name_plural': 'Roles',
'ordering': ['organization', 'name'],
'unique_together': {('organization', 'name')},
},
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 5.2 on 2025-04-06 03:55
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0010_role'),
('core', '0022_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.CreateModel(
name='RoleNotes',
fields=[
('modelnotes_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelnotes')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='notes', to='access.role', verbose_name='Model')),
],
options={
'verbose_name': 'Role Note',
'verbose_name_plural': 'Role Notes',
'db_table': 'access_role_notes',
'ordering': ['-created'],
},
bases=('core.modelnotes',),
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 5.2 on 2025-04-06 03:58
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('access', '0011_rolenotes'),
('core', '0022_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.CreateModel(
name='RoleHistory',
fields=[
('modelhistory_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.modelhistory')),
('model', models.ForeignKey(help_text='Model this note belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='history', to='access.role', verbose_name='Model')),
],
options={
'verbose_name': 'Role History',
'verbose_name_plural': 'Role History',
'db_table': 'access_role_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
]

View File

@ -1,4 +1,4 @@
# Generated by Django 5.1.5 on 2025-04-03 22:11
# Generated by Django 5.2 on 2025-04-10 02:34
from django.db import migrations, models
@ -13,6 +13,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='ticketlinkeditem',
name='item_type',
field=models.IntegerField(choices=[(1, 'Cluster'), (2, 'Config Group'), (3, 'Device'), (4, 'Operating System'), (5, 'Service'), (6, 'Software'), (7, 'Knowledge Base'), (8, 'Organization'), (9, 'Team'), (10, 'Feature Flag'), (11, 'Software Version'), (12, 'Ticket Category'), (13, 'Ticket Comment Category'), (14, 'Project State'), (15, 'Git Repository'), (16, 'Entity')], help_text='Python Model location for linked item', verbose_name='Item Type'),
field=models.IntegerField(choices=[(1, 'Cluster'), (2, 'Config Group'), (3, 'Device'), (4, 'Operating System'), (5, 'Service'), (6, 'Software'), (7, 'Knowledge Base'), (8, 'Organization'), (9, 'Team'), (10, 'Feature Flag'), (11, 'Software Version'), (12, 'Ticket Category'), (13, 'Ticket Comment Category'), (14, 'Project State'), (15, 'Git Repository'), (16, 'Entity'), (17, 'Role')], help_text='Python Model location for linked item', verbose_name='Item Type'),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 5.2 on 2025-04-06 03:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0021_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.AlterField(
model_name='ticketlinkeditem',
name='item_type',
field=models.IntegerField(choices=[(1, 'Cluster'), (2, 'Config Group'), (3, 'Device'), (4, 'Operating System'), (5, 'Service'), (6, 'Software'), (7, 'Knowledge Base'), (8, 'Organization'), (9, 'Team'), (10, 'Feature Flag'), (11, 'Software Version'), (12, 'Ticket Category'), (13, 'Ticket Comment Category'), (14, 'Project State'), (15, 'Git Repository'), (16, 'Entity'), (17, 'Role')], help_text='Python Model location for linked item', verbose_name='Item Type'),
),
]