mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
feat: implement basic Letter model and unit tests
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
# Generated by Django 6.0.4 on 2026-04-10 15:26
|
||||
|
||||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="Letter",
|
||||
fields=[
|
||||
("public_id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
(
|
||||
"type",
|
||||
models.CharField(
|
||||
choices=[("KEPT", "Kept"), ("SENT", "Sent"), ("VAULT", "Vault")], default="KEPT", max_length=10
|
||||
),
|
||||
),
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
choices=[("DRAFT", "Draft"), ("SEALED", "Sealed"), ("BURNED", "Burned")],
|
||||
default="DRAFT",
|
||||
max_length=10,
|
||||
),
|
||||
),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, related_name="letters", to=settings.AUTH_USER_MODEL
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user