You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
275 lines
8.9 KiB
275 lines
8.9 KiB
# -*- coding: utf-8 -*- |
|
# Generated by Django 1.11.2 on 2017-07-30 21:40 |
|
from __future__ import unicode_literals |
|
|
|
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="Account", |
|
fields=[ |
|
( |
|
"id", |
|
models.AutoField( |
|
auto_created=True, |
|
primary_key=True, |
|
serialize=False, |
|
verbose_name="ID", |
|
), |
|
), |
|
( |
|
"card_number", |
|
models.CharField( |
|
blank=True, |
|
max_length=32, |
|
null=True, |
|
unique=True, |
|
verbose_name="card number", |
|
), |
|
), |
|
( |
|
"pin", |
|
models.CharField(blank=True, max_length=32, verbose_name="PIN"), |
|
), |
|
( |
|
"daily_digest", |
|
models.BooleanField(default=True, verbose_name="daily digest"), |
|
), |
|
( |
|
"credit", |
|
models.DecimalField( |
|
decimal_places=2, default=0, max_digits=5, verbose_name="credit" |
|
), |
|
), |
|
( |
|
"user", |
|
models.OneToOneField( |
|
on_delete=django.db.models.deletion.CASCADE, |
|
to=settings.AUTH_USER_MODEL, |
|
), |
|
), |
|
], |
|
options={ |
|
"verbose_name": "account", |
|
"verbose_name_plural": "accounts", |
|
}, |
|
), |
|
migrations.CreateModel( |
|
name="Product", |
|
fields=[ |
|
( |
|
"id", |
|
models.AutoField( |
|
auto_created=True, |
|
primary_key=True, |
|
serialize=False, |
|
verbose_name="ID", |
|
), |
|
), |
|
( |
|
"name", |
|
models.CharField(max_length=32, unique=True, verbose_name="name"), |
|
), |
|
( |
|
"price", |
|
models.DecimalField( |
|
decimal_places=2, max_digits=5, verbose_name="price" |
|
), |
|
), |
|
("active", models.BooleanField(default=True, verbose_name="active")), |
|
( |
|
"image", |
|
models.ImageField( |
|
blank=True, |
|
null=True, |
|
upload_to="products", |
|
verbose_name="image", |
|
), |
|
), |
|
( |
|
"image_thumbnail", |
|
models.ImageField( |
|
blank=True, |
|
null=True, |
|
upload_to="products_thumb", |
|
verbose_name="image", |
|
), |
|
), |
|
], |
|
options={ |
|
"verbose_name": "product", |
|
"verbose_name_plural": "products", |
|
}, |
|
), |
|
migrations.CreateModel( |
|
name="ProductBarcode", |
|
fields=[ |
|
( |
|
"id", |
|
models.AutoField( |
|
auto_created=True, |
|
primary_key=True, |
|
serialize=False, |
|
verbose_name="ID", |
|
), |
|
), |
|
( |
|
"barcode", |
|
models.CharField( |
|
max_length=32, unique=True, verbose_name="barcode" |
|
), |
|
), |
|
( |
|
"comment", |
|
models.CharField( |
|
blank=True, max_length=128, verbose_name="comment" |
|
), |
|
), |
|
( |
|
"product", |
|
models.ForeignKey( |
|
on_delete=django.db.models.deletion.CASCADE, |
|
to="cashonly_core.Product", |
|
verbose_name="product", |
|
), |
|
), |
|
], |
|
options={ |
|
"verbose_name": "barcode", |
|
"verbose_name_plural": "barcodes", |
|
}, |
|
), |
|
migrations.CreateModel( |
|
name="ProductCategory", |
|
fields=[ |
|
( |
|
"id", |
|
models.AutoField( |
|
auto_created=True, |
|
primary_key=True, |
|
serialize=False, |
|
verbose_name="ID", |
|
), |
|
), |
|
( |
|
"name", |
|
models.CharField(max_length=32, unique=True, verbose_name="name"), |
|
), |
|
( |
|
"comment", |
|
models.CharField( |
|
blank=True, max_length=128, verbose_name="comment" |
|
), |
|
), |
|
], |
|
options={ |
|
"verbose_name": "product category", |
|
"verbose_name_plural": "product categories", |
|
}, |
|
), |
|
migrations.CreateModel( |
|
name="SalesLogEntry", |
|
fields=[ |
|
( |
|
"id", |
|
models.AutoField( |
|
auto_created=True, |
|
primary_key=True, |
|
serialize=False, |
|
verbose_name="ID", |
|
), |
|
), |
|
("count", models.IntegerField(verbose_name="count")), |
|
( |
|
"unit_price", |
|
models.DecimalField( |
|
decimal_places=2, max_digits=5, verbose_name="unit price" |
|
), |
|
), |
|
( |
|
"timestamp", |
|
models.DateTimeField(auto_now_add=True, verbose_name="timestamp"), |
|
), |
|
( |
|
"account", |
|
models.ForeignKey( |
|
on_delete=django.db.models.deletion.CASCADE, |
|
to="cashonly_core.Account", |
|
verbose_name="account", |
|
), |
|
), |
|
( |
|
"product", |
|
models.ForeignKey( |
|
on_delete=django.db.models.deletion.CASCADE, |
|
to="cashonly_core.Product", |
|
verbose_name="product", |
|
), |
|
), |
|
], |
|
options={ |
|
"verbose_name": "sales log entry", |
|
"verbose_name_plural": "sales log entries", |
|
}, |
|
), |
|
migrations.CreateModel( |
|
name="Transaction", |
|
fields=[ |
|
( |
|
"id", |
|
models.AutoField( |
|
auto_created=True, |
|
primary_key=True, |
|
serialize=False, |
|
verbose_name="ID", |
|
), |
|
), |
|
( |
|
"timestamp", |
|
models.DateTimeField(auto_now_add=True, verbose_name="timestamp"), |
|
), |
|
("subject", models.CharField(max_length=32, verbose_name="subject")), |
|
("description", models.TextField(verbose_name="description")), |
|
( |
|
"amount", |
|
models.DecimalField( |
|
decimal_places=2, max_digits=5, verbose_name="amount" |
|
), |
|
), |
|
( |
|
"account", |
|
models.ForeignKey( |
|
on_delete=django.db.models.deletion.CASCADE, |
|
to="cashonly_core.Account", |
|
verbose_name="account", |
|
), |
|
), |
|
], |
|
options={ |
|
"verbose_name": "transaction", |
|
"verbose_name_plural": "transactions", |
|
}, |
|
), |
|
migrations.AddField( |
|
model_name="product", |
|
name="category", |
|
field=models.ForeignKey( |
|
blank=True, |
|
null=True, |
|
on_delete=django.db.models.deletion.CASCADE, |
|
to="cashonly_core.ProductCategory", |
|
verbose_name="category", |
|
), |
|
), |
|
]
|
|
|