Skip to content

Commit

Permalink
Adiciona as migrações de banco de dados
Browse files Browse the repository at this point in the history
  • Loading branch information
robertatakenaka committed Mar 28, 2024
1 parent d7f1ced commit 125b4d0
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 0 deletions.
119 changes: 119 additions & 0 deletions proc/migrations/0002_procreport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Generated by Django 5.0.3 on 2024-03-28 11:53

import django.db.models.deletion
import proc.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("collection", "0002_remove_websiteconfiguration_api_token_and_more"),
("proc", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name="ProcReport",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"created",
models.DateTimeField(
auto_now_add=True, verbose_name="Creation date"
),
),
(
"updated",
models.DateTimeField(
auto_now=True, verbose_name="Last update date"
),
),
(
"pid",
models.CharField(
blank=True, max_length=23, null=True, verbose_name="PID"
),
),
(
"task_name",
models.CharField(
blank=True,
max_length=32,
null=True,
verbose_name="Procedure name",
),
),
(
"file",
models.FileField(
blank=True,
null=True,
upload_to=proc.models.proc_report_directory_path,
),
),
(
"report_date",
models.CharField(
blank=True,
max_length=34,
null=True,
verbose_name="Identification",
),
),
(
"collection",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="collection.collection",
),
),
(
"creator",
models.ForeignKey(
editable=False,
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)s_creator",
to=settings.AUTH_USER_MODEL,
verbose_name="Creator",
),
),
(
"updated_by",
models.ForeignKey(
blank=True,
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="%(class)s_last_mod_user",
to=settings.AUTH_USER_MODEL,
verbose_name="Updater",
),
),
],
options={
"verbose_name": "Processing report",
"verbose_name_plural": "Processing reports",
"indexes": [
models.Index(fields=["pid"], name="proc_procre_pid_2ea179_idx"),
models.Index(
fields=["task_name"], name="proc_procre_task_na_33520a_idx"
),
models.Index(
fields=["report_date"], name="proc_procre_report__370dc9_idx"
),
],
},
),
]
28 changes: 28 additions & 0 deletions proc/migrations/0003_procreport_item_type_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 5.0.3 on 2024-03-28 12:58

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("collection", "0002_remove_websiteconfiguration_api_token_and_more"),
("proc", "0002_procreport"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.AddField(
model_name="procreport",
name="item_type",
field=models.CharField(
blank=True, max_length=16, null=True, verbose_name="Item type"
),
),
migrations.AddIndex(
model_name="procreport",
index=models.Index(
fields=["item_type"], name="proc_procre_item_ty_0b33db_idx"
),
),
]

0 comments on commit 125b4d0

Please sign in to comment.