From 8a1d5f113700e8c9dac7bc98bc256649656821ac Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Fri, 6 Aug 2021 15:26:34 +0200 Subject: [PATCH] chore: Create deposits app initial migration --- deposits/migrations/0001_initial.py | 47 +++++++++++++++++++++++++++++ deposits/migrations/__init__.py | 0 2 files changed, 47 insertions(+) create mode 100644 deposits/migrations/0001_initial.py create mode 100644 deposits/migrations/__init__.py diff --git a/deposits/migrations/0001_initial.py b/deposits/migrations/0001_initial.py new file mode 100644 index 00000000..47052f8a --- /dev/null +++ b/deposits/migrations/0001_initial.py @@ -0,0 +1,47 @@ +# Generated by Django 2.2.18 on 2021-08-06 13:10 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import re2o.mixins + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='DepositItem', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True, verbose_name='designation')), + ('deposit_amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='deposit amount')), + ], + options={ + 'verbose_name': 'deposit item', + 'verbose_name_plural': 'deposit items', + }, + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + ), + migrations.CreateModel( + name='Deposit', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('date', models.DateTimeField(auto_now_add=True, verbose_name='date')), + ('returned', models.BooleanField(default=False, verbose_name='returned')), + ('item', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='deposits.DepositItem')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'deposit', + 'verbose_name_plural': 'deposits', + 'abstract': False, + }, + bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), + ), + ] diff --git a/deposits/migrations/__init__.py b/deposits/migrations/__init__.py new file mode 100644 index 00000000..e69de29b