2022-02-16 16:06:51 -05:00
|
|
|
# Generated by Django 4.0.2 on 2022-02-16 21:19
|
2022-01-24 22:03:10 -05:00
|
|
|
|
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 = [
|
2022-02-16 16:06:51 -05:00
|
|
|
("membershipworks", "0001_initial"),
|
2022-01-24 22:03:10 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
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-16 16:06:51 -05:00
|
|
|
name="LockerInfo",
|
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()),
|
2022-02-16 16:06:51 -05:00
|
|
|
(
|
|
|
|
"blind_code",
|
|
|
|
models.CharField(
|
|
|
|
blank=True,
|
|
|
|
help_text="Stamped on some keys. Usually D###A.",
|
|
|
|
max_length=5,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
"bitting_code",
|
|
|
|
models.CharField(
|
|
|
|
blank=True,
|
|
|
|
help_text="National Disc Tumbler, depths 1-4. Read bow-to-tip.",
|
|
|
|
max_length=5,
|
|
|
|
),
|
|
|
|
),
|
2022-02-14 12:44:42 -05:00
|
|
|
(
|
|
|
|
"locker_unit",
|
|
|
|
models.ForeignKey(
|
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2022-02-16 16:06:51 -05:00
|
|
|
related_name="lockers",
|
2022-02-14 12:44:42 -05:00
|
|
|
to="rentals.lockerunit",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
(
|
2022-02-16 16:06:51 -05:00
|
|
|
"renter",
|
2022-02-14 12:44:42 -05:00
|
|
|
models.ForeignKey(
|
2022-02-16 16:06:51 -05:00
|
|
|
blank=True,
|
|
|
|
db_constraint=False,
|
|
|
|
null=True,
|
2022-02-14 12:44:42 -05:00
|
|
|
on_delete=django.db.models.deletion.CASCADE,
|
2022-02-16 16:06:51 -05:00
|
|
|
to="membershipworks.member",
|
2022-02-14 12:44:42 -05:00
|
|
|
),
|
|
|
|
),
|
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-02-16 16:06:51 -05:00
|
|
|
migrations.AddConstraint(
|
|
|
|
model_name="lockerinfo",
|
|
|
|
constraint=models.UniqueConstraint(
|
|
|
|
fields=("locker_unit", "column", "row"), name="unique_locker_info"
|
|
|
|
),
|
|
|
|
),
|
2022-01-24 22:03:10 -05:00
|
|
|
]
|