BuyAndKnow/bk_api/bills/migrations/0001_initial.py
Stanislaw-Golebiewski 38964811ae update api .gitignore
2020-01-12 20:07:57 +01:00

81 lines
4.1 KiB
Python

# Generated by Django 3.0.2 on 2020-01-12 18:45
from django.conf import settings
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='Tag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('color', models.CharField(default='#f2f2f2', max_length=30)),
('created_at', models.DateField(auto_now_add=True)),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tags', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='ShopTag',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('color', models.CharField(default='#9e9e9e', max_length=30)),
('created_at', models.DateField(auto_now_add=True)),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shop_tags', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Shop',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('created_at', models.DateField(auto_now_add=True)),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shops', to=settings.AUTH_USER_MODEL)),
('tags', models.ManyToManyField(blank=True, to='bills.ShopTag')),
],
),
migrations.CreateModel(
name='Receipt',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateField(auto_now_add=True)),
('date', models.DateField()),
('total_price', models.FloatField(default=0.0)),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='receipts', to=settings.AUTH_USER_MODEL)),
('shop', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='receipts', to='bills.Shop')),
],
),
migrations.CreateModel(
name='ProductOnBill',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('created_at', models.DateField(auto_now_add=True)),
('price', models.DecimalField(decimal_places=2, max_digits=5)),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='products_on_bills', to=settings.AUTH_USER_MODEL)),
('receipt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='bills.Receipt')),
('tags', models.ManyToManyField(blank=True, to='bills.Tag')),
],
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=30)),
('created_at', models.DateField(auto_now_add=True)),
('default_tags', models.ManyToManyField(blank=True, to='bills.Tag')),
('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='products', to=settings.AUTH_USER_MODEL)),
],
),
]