2022-01-27 14:55:27 -05:00
|
|
|
# Generated by Django 3.2.11 on 2022-01-27 22:14
|
2022-01-24 22:03:10 -05:00
|
|
|
|
|
|
|
from django.conf import settings
|
2022-01-27 14:55:27 -05:00
|
|
|
import django.core.validators
|
2022-01-24 22:03:10 -05:00
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
initial = True
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
2022-02-14 12:44:42 -05:00
|
|
|
name="LockerBank",
|
2022-01-24 22:03:10 -05:00
|
|
|
fields=[
|
2022-02-14 12:44:42 -05:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.BigAutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("name", models.CharField(max_length=200)),
|
|
|
|
("location", models.CharField(max_length=200)),
|
|
|
|
("slug", models.SlugField(unique=True)),
|
2022-01-24 22:03:10 -05:00
|
|
|
],
|
|
|
|
),
|
2022-01-27 14:55:27 -05:00
|
|
|
migrations.CreateModel(
|
2022-02-14 12:44:42 -05:00
|
|
|
name="LockerUnit",
|
2022-01-27 14:55:27 -05:00
|
|
|
fields=[
|
2022-02-14 12:44:42 -05:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.BigAutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("index", models.PositiveIntegerField()),
|
|
|
|
(
|
|
|
|
"first_letter",
|
|
|
|
models.CharField(
|
|
|
|
max_length=1,
|
|
|
|
unique=True,
|
|
|
|
validators=[django.core.validators.RegexValidator("[A-Z]")],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("first_number", models.PositiveIntegerField()),
|
|
|
|
("rows", models.PositiveIntegerField(default=5)),
|
|
|
|
("columns", models.PositiveIntegerField(default=2)),
|
|
|
|
(
|
|
|
|
"bank",
|
|
|
|
models.ForeignKey(
|
|
|
|
null=True,
|
|
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
|
|
related_name="units",
|
|
|
|
to="rentals.lockerbank",
|
|
|
|
),
|
|
|
|
),
|
2022-01-27 14:55:27 -05:00
|
|
|
],
|
|
|
|
options={
|
2022-02-14 12:44:42 -05:00
|
|
|
"ordering": ["index"],
|
2022-01-27 14:55:27 -05:00
|
|
|
},
|
|
|
|
),
|
2022-01-24 22:03:10 -05:00
|
|
|
migrations.CreateModel(
|
2022-02-14 12:44:42 -05:00
|
|
|
name="LockerRental",
|
2022-01-24 22:03:10 -05:00
|
|
|
fields=[
|
2022-02-14 12:44:42 -05:00
|
|
|
(
|
|
|
|
"id",
|
|
|
|
models.BigAutoField(
|
|
|
|
auto_created=True,
|
|
|
|
primary_key=True,
|
|
|
|
serialize=False,
|
|
|
|
verbose_name="ID",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
("column", models.PositiveIntegerField()),
|
|
|
|
("row", models.PositiveIntegerField()),
|
|
|
|
(
|
|
|
|
"locker_unit",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
related_name="rentals",
|
|
|
|
to="rentals.lockerunit",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"user",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
|
|
to=settings.AUTH_USER_MODEL,
|
|
|
|
),
|
|
|
|
),
|
2022-01-24 22:03:10 -05:00
|
|
|
],
|
|
|
|
),
|
2022-01-27 14:55:27 -05:00
|
|
|
migrations.AddConstraint(
|
2022-02-14 12:44:42 -05:00
|
|
|
model_name="lockerunit",
|
|
|
|
constraint=models.UniqueConstraint(
|
|
|
|
fields=("bank", "index"), name="unique_bank_index"
|
|
|
|
),
|
2022-01-27 14:55:27 -05:00
|
|
|
),
|
2022-01-24 22:03:10 -05:00
|
|
|
]
|