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(
|
|
|
|
name='LockerBank',
|
|
|
|
fields=[
|
|
|
|
('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-27 14:55:27 -05:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='LockerUnit',
|
|
|
|
fields=[
|
|
|
|
('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')),
|
|
|
|
],
|
|
|
|
options={
|
|
|
|
'ordering': ['index'],
|
|
|
|
},
|
|
|
|
),
|
2022-01-24 22:03:10 -05:00
|
|
|
migrations.CreateModel(
|
|
|
|
name='LockerRental',
|
|
|
|
fields=[
|
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('column', models.PositiveIntegerField()),
|
2022-01-27 14:55:27 -05:00
|
|
|
('row', models.PositiveIntegerField()),
|
|
|
|
('locker_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rentals', to='rentals.lockerunit')),
|
2022-01-24 22:03:10 -05:00
|
|
|
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
|
|
],
|
|
|
|
),
|
2022-01-27 14:55:27 -05:00
|
|
|
migrations.AddConstraint(
|
|
|
|
model_name='lockerunit',
|
|
|
|
constraint=models.UniqueConstraint(fields=('bank', 'index'), name='unique_bank_index'),
|
|
|
|
),
|
2022-01-24 22:03:10 -05:00
|
|
|
]
|