DocManagerBackend/docmanager_backend/document_requests/migrations/0001_initial.py

102 lines
3.2 KiB
Python

# Generated by Django 5.1.3 on 2024-12-03 16:27
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("documents", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="DocumentRequest",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"date_requested",
models.DateTimeField(
default=django.utils.timezone.now, editable=False
),
),
("college", models.CharField(max_length=64)),
("purpose", models.TextField(max_length=512)),
(
"status",
models.CharField(
choices=[
("pending", "Pending"),
("approved", "Approved"),
("denied", "Denied"),
],
default="pending",
max_length=32,
),
),
(
"type",
models.CharField(
choices=[("softcopy", "Softcopy"), ("hardcopy", "Hardcopy")],
default="softcopy",
max_length=16,
),
),
(
"requester",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="DocumentRequestUnit",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("copies", models.IntegerField(default=1)),
(
"document",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="documents.document",
),
),
(
"document_request",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="document_requests.documentrequest",
),
),
],
),
migrations.AddField(
model_name="documentrequest",
name="documents",
field=models.ManyToManyField(to="document_requests.documentrequestunit"),
),
]