feat(core): Migration for model CenturionNotes

ref: #776 #778
This commit is contained in:
2025-05-29 13:48:22 +09:30
parent 21b3aa3b4a
commit 084bdf61bd

View File

@ -0,0 +1,112 @@
# Generated by Django 5.1.9 on 2025-05-29 04:03
import access.fields
import access.models.tenancy_abstract
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("access", "0010_company_alter_entity_entity_type_alter_person_dob_and_more"),
("contenttypes", "0002_remove_content_type_name"),
("core", "0026_remove_centurionaudit_model_notes"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="CenturionModelNote",
fields=[
(
"id",
models.AutoField(
help_text="ID of the item",
primary_key=True,
serialize=False,
unique=True,
verbose_name="ID",
),
),
(
"created",
access.fields.AutoCreatedField(
default=django.utils.timezone.now,
editable=False,
help_text="Date and time of creation",
verbose_name="Created",
),
),
(
"body",
models.TextField(
help_text="The tid bit of information you wish to add",
verbose_name="Note",
),
),
(
"modified",
access.fields.AutoLastModifiedField(
default=django.utils.timezone.now,
editable=False,
help_text="Date and time of last modification",
verbose_name="Modified",
),
),
(
"content_type",
models.ForeignKey(
blank=True,
help_text="Model this note is for",
on_delete=django.db.models.deletion.CASCADE,
to="contenttypes.contenttype",
verbose_name="Content Model",
),
),
(
"created_by",
models.ForeignKey(
blank=True,
help_text="User whom added the Note",
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to=settings.AUTH_USER_MODEL,
verbose_name="Created By",
),
),
(
"modified_by",
models.ForeignKey(
blank=True,
help_text="User whom modified the note",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to=settings.AUTH_USER_MODEL,
verbose_name="Edited By",
),
),
(
"organization",
models.ForeignKey(
help_text="Tenant this belongs to",
on_delete=django.db.models.deletion.CASCADE,
related_name="+",
to="access.tenant",
validators=[
access.models.tenancy_abstract.TenancyAbstractModel.validatate_organization_exists
],
verbose_name="Tenant",
),
),
],
options={
"verbose_name": "Centurion Model Note",
"verbose_name_plural": "Centurion Model Notes",
"ordering": ["-created"],
},
),
]