3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-05 01:16:28 +00:00
coope/gestion/migrations/0001_initial.py

155 lines
8.2 KiB
Python
Raw Normal View History

2018-08-31 12:46:35 +00:00
# Generated by Django 2.1 on 2018-08-31 12:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import gestion.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('preferences', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Barrel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=20)),
('stockHold', models.IntegerField(default=0)),
('barcode', models.CharField(max_length=20, unique=True)),
('amount', models.DecimalField(decimal_places=2, max_digits=5)),
('capacity', models.IntegerField(default=30)),
('active', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='ConsumptionHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.PositiveIntegerField(default=0)),
('date', models.DateTimeField(auto_now_add=True)),
('amount', models.DecimalField(decimal_places=2, default=0, max_digits=7)),
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='consumption_selled', to=settings.AUTH_USER_MODEL)),
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='consumption_taken', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Menu',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('amount', models.DecimalField(decimal_places=2, max_digits=5)),
('barcode', models.CharField(max_length=20, unique=True)),
('is_active', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='MenuHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.PositiveIntegerField(default=0)),
('date', models.DateTimeField(auto_now_add=True)),
('amount', models.DecimalField(decimal_places=2, default=0, max_digits=5)),
('PaymentMethod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod')),
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='menu_selled', to=settings.AUTH_USER_MODEL)),
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='menu_taken', to=settings.AUTH_USER_MODEL)),
('menu', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Menu')),
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=40)),
('amount', models.DecimalField(decimal_places=2, max_digits=5)),
('stockHold', models.IntegerField(default=0)),
('stockBar', models.IntegerField(default=0)),
('barcode', models.CharField(max_length=20, unique=True)),
('category', models.CharField(choices=[('PP', 'Pinte Pression'), ('DP', 'Demi Pression'), ('GP', 'Galopin pression'), ('BT', 'Bouteille'), ('SO', 'Soft'), ('FO', 'Bouffe')], default='FO', max_length=2)),
('needQuantityButton', models.BooleanField(default=False)),
('is_active', models.BooleanField(default=True)),
('is_beer', models.BooleanField(default=False)),
('volume', models.IntegerField(default=0)),
('deg', models.DecimalField(decimal_places=2, default=0, max_digits=5)),
],
),
migrations.CreateModel(
name='Raming',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateTimeField(auto_now_add=True)),
('barrel', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Barrel')),
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Refund',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateTimeField(auto_now_add=True)),
('amount', models.DecimalField(decimal_places=2, max_digits=5)),
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='refund_realized', to=settings.AUTH_USER_MODEL)),
('cutsomer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='refund_taken', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Reload',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('amount', models.DecimalField(decimal_places=2, max_digits=5)),
('date', models.DateTimeField(auto_now_add=True)),
('PaymentMethod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod')),
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reload_realized', to=settings.AUTH_USER_MODEL)),
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reload_taken', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Stocking',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateTimeField(auto_now_add=True)),
],
),
migrations.AddField(
model_name='menu',
name='articles',
field=models.ManyToManyField(to='gestion.Product'),
),
migrations.AddField(
model_name='consumptionhistory',
name='menu',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='gestion.MenuHistory'),
),
migrations.AddField(
model_name='consumptionhistory',
name='paymentMethod',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod'),
),
migrations.AddField(
model_name='consumptionhistory',
name='product',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Product'),
),
migrations.AddField(
model_name='barrel',
name='demi',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='futd', to='gestion.Product', validators=[gestion.models.isDemi]),
),
migrations.AddField(
model_name='barrel',
name='galopin',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='futg', to='gestion.Product', validators=[gestion.models.isGalopin]),
),
migrations.AddField(
model_name='barrel',
name='pinte',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='futp', to='gestion.Product', validators=[gestion.models.isPinte]),
),
]