Files
centurion_erp/app/devops/migrations/0001_initial.py
2025-03-16 11:18:02 +09:30

103 lines
7.0 KiB
Python

# Generated by Django 5.1.5 on 2025-03-16 01:47
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):
initial = True
dependencies = [
('access', '0004_organizationhistory_teamhistory'),
('core', '0017_alter_ticketlinkeditem_item_type_ticketcategorynotes_and_more'),
('itam', '0010_alter_software_organization'),
]
operations = [
migrations.CreateModel(
name='CheckIn',
fields=[
('id', models.AutoField(help_text='Primary key of the entry', primary_key=True, serialize=False, unique=True, verbose_name='ID')),
('version', models.TextField(blank=True, help_text='Version of the deployed software', max_length=80, null=True, verbose_name='Deployed Version')),
('deployment_id', models.CharField(help_text='Unique Deployment ID', max_length=64, verbose_name='Deployment ID')),
('feature', models.TextField(help_text='Feature that was checked into', max_length=30, verbose_name='Feature')),
('created', access.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, help_text='Date and time of creation', verbose_name='Created')),
('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')),
('software', models.ForeignKey(help_text='Software related to the checkin', on_delete=django.db.models.deletion.CASCADE, related_name='+', to='itam.software', verbose_name='Software')),
],
options={
'verbose_name': 'Deployment Check In',
'verbose_name_plural': 'Deployment Check Ins',
'ordering': ['organization', 'software', 'feature'],
},
),
migrations.CreateModel(
name='FeatureFlag',
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 feature', max_length=50, verbose_name='Name')),
('description', models.TextField(blank=True, default=None, help_text='Description of this feature', max_length=300, null=True, verbose_name='Description')),
('enabled', models.BooleanField(default=False, help_text='Is this feature enabled', verbose_name='Enabled')),
('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')),
('software', models.ForeignKey(help_text='Software this feature flag is for', on_delete=django.db.models.deletion.PROTECT, related_name='feature_flags', to='itam.software', verbose_name='Software')),
],
options={
'verbose_name': 'Feature Flag',
'verbose_name_plural': 'Feature Flag',
'ordering': ['name'],
},
),
migrations.CreateModel(
name='FeatureFlagHistory',
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='devops.featureflag', verbose_name='Model')),
],
options={
'verbose_name': 'Feature Flag History',
'verbose_name_plural': 'Feature Flags History',
'db_table': 'devops_feature_flag_history',
'ordering': ['-created'],
},
bases=('core.modelhistory',),
),
migrations.CreateModel(
name='FeatureFlagNotes',
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='devops.featureflag', verbose_name='Model')),
],
options={
'verbose_name': 'Feature Flag Note',
'verbose_name_plural': 'Feature Flag Notes',
'db_table': 'devops_feature_flag_notes',
'ordering': ['-created'],
},
bases=('core.modelnotes',),
),
migrations.CreateModel(
name='SoftwareEnableFeatureFlag',
fields=[
('id', models.AutoField(help_text='Primary key of the entry', primary_key=True, serialize=False, unique=True, verbose_name='ID')),
('enabled', models.BooleanField(default=False, help_text='Is feature flagging enabled for this software', verbose_name='Enabled')),
('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')),
('software', models.ForeignKey(help_text='Software this feature flag is for', on_delete=django.db.models.deletion.PROTECT, related_name='feature_flagging', to='itam.software', verbose_name='Software')),
],
options={
'verbose_name': 'Software Feature Flagging',
'verbose_name_plural': 'Software Feature Flaggings',
'ordering': ['software', 'organization'],
'unique_together': {('organization', 'software')},
},
),
]