Files
backend/api/record/migrations/0001_initial.py
2025-09-22 18:43:29 -06:00

53 lines
2.2 KiB
Python

# Generated by Django 5.2.3 on 2025-07-14 16:14
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('customs', '0001_initial'),
('organization', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='DocumentType',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nombre', models.CharField(max_length=100, unique=True)),
('descripcion', models.TextField(blank=True, null=True)),
],
options={
'verbose_name': 'Tipo de Documento',
'verbose_name_plural': 'Tipos de Documento',
'db_table': 'document_type',
'ordering': ['nombre'],
},
),
migrations.CreateModel(
name='Document',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('archivo', models.FileField(max_length=400, upload_to='documents/')),
('extension', models.CharField(blank=True, max_length=60, null=True)),
('size', models.PositiveIntegerField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('organizacion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='organization.organizacion')),
('pedimento', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='customs.pedimento')),
('document_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='record.documenttype')),
],
options={
'verbose_name': 'Document',
'verbose_name_plural': 'Documents',
'db_table': 'document',
'ordering': ['created_at'],
},
),
]