3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-30 00:22:26 +00:00
coope/gestion/migrations/0001_initial.py

166 lines
9.5 KiB
Python
Raw Normal View History

2018-10-05 22:03:02 +00:00
# Generated by Django 2.1 on 2018-10-04 09:32
2018-08-31 12:46:35 +00:00
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 = [
('preferences', '0001_initial'),
2018-10-05 22:03:02 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2018-08-31 12:46:35 +00:00
]
operations = [
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)),
],
),
2018-10-05 22:03:02 +00:00
migrations.CreateModel(
name='Keg',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=20, unique=True, verbose_name='Nom')),
('stockHold', models.IntegerField(default=0, verbose_name='Stock en soute')),
('barcode', models.CharField(max_length=20, unique=True, verbose_name='Code barre')),
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Prix du fût')),
('capacity', models.IntegerField(default=30, verbose_name='Capacité (L)')),
('is_active', models.BooleanField(default=False, verbose_name='Actif')),
],
),
migrations.CreateModel(
name='KegHistory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('openingDate', models.DateTimeField(auto_now_add=True)),
('quantitySold', models.DecimalField(decimal_places=2, max_digits=5)),
('amountSold', models.DecimalField(decimal_places=2, max_digits=5)),
('closingDate', models.DateTimeField()),
('isCurrentKegHistory', models.BooleanField(default=True)),
('Keg', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Keg')),
],
),
2018-08-31 12:46:35 +00:00
migrations.CreateModel(
name='Menu',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2018-10-05 22:03:02 +00:00
('name', models.CharField(max_length=255, verbose_name='Nom')),
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant')),
('barcode', models.CharField(max_length=20, unique=True, verbose_name='Code barre')),
('is_active', models.BooleanField(default=False, verbose_name='Actif')),
2018-08-31 12:46:35 +00:00
],
),
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')),
2018-10-05 22:03:02 +00:00
('name', models.CharField(max_length=40, unique=True, verbose_name='Nom')),
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Prix de vente')),
('stockHold', models.IntegerField(default=0, verbose_name='Stock en soute')),
('stockBar', models.IntegerField(default=0, verbose_name='Stock en bar')),
('barcode', models.CharField(max_length=20, unique=True, verbose_name='Code barre')),
('category', models.CharField(choices=[('PP', 'Pinte Pression'), ('DP', 'Demi Pression'), ('GP', 'Galopin pression'), ('BT', 'Bouteille'), ('SO', 'Soft'), ('FO', 'Bouffe autre que panini'), ('PA', 'Bouffe pour panini')], default='FO', max_length=2, verbose_name='Catégorie')),
('needQuantityButton', models.BooleanField(default=False, verbose_name='Bouton quantité')),
('is_active', models.BooleanField(default=True, verbose_name='Actif')),
2018-08-31 12:46:35 +00:00
('volume', models.IntegerField(default=0)),
2018-10-05 22:03:02 +00:00
('deg', models.DecimalField(decimal_places=2, default=0, max_digits=5, verbose_name='Degré')),
2018-08-31 12:46:35 +00:00
],
),
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)),
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
2018-10-05 22:03:02 +00:00
('keg', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='gestion.Keg')),
2018-08-31 12:46:35 +00:00
],
),
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)),
2018-10-05 22:03:02 +00:00
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant')),
2018-08-31 12:46:35 +00:00
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='refund_realized', to=settings.AUTH_USER_MODEL)),
2018-10-05 22:03:02 +00:00
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='refund_taken', to=settings.AUTH_USER_MODEL, verbose_name='Client')),
2018-08-31 12:46:35 +00:00
],
),
migrations.CreateModel(
name='Reload',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2018-10-05 22:03:02 +00:00
('amount', models.DecimalField(decimal_places=2, max_digits=5, verbose_name='Montant')),
2018-08-31 12:46:35 +00:00
('date', models.DateTimeField(auto_now_add=True)),
2018-10-05 22:03:02 +00:00
('PaymentMethod', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='preferences.PaymentMethod', verbose_name='Moyen de paiement')),
2018-08-31 12:46:35 +00:00
('coopeman', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reload_realized', to=settings.AUTH_USER_MODEL)),
2018-10-05 22:03:02 +00:00
('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reload_taken', to=settings.AUTH_USER_MODEL, verbose_name='Client')),
2018-08-31 12:46:35 +00:00
],
),
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',
2018-10-05 22:03:02 +00:00
field=models.ManyToManyField(to='gestion.Product', verbose_name='Produits'),
),
migrations.AddField(
model_name='keg',
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='keg',
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='keg',
name='pinte',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='futp', to='gestion.Product', validators=[gestion.models.isPinte]),
2018-08-31 12:46:35 +00:00
),
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'),
),
]