Add migrations

This commit is contained in:
Sebastian Lohff 2019-12-03 20:49:41 +01:00
parent a4c308af6f
commit 37897b6a12
6 changed files with 177 additions and 0 deletions

View File

@ -0,0 +1,63 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-10-24 01:07
from __future__ import unicode_literals
from decimal import Decimal
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='Buyable',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('price', models.DecimalField(decimal_places=2, max_digits=8)),
('image', models.ImageField(help_text=b'<strong>The Image needs to have a 1:1 aspect ratio.</strong>', upload_to=b'img/buyable/')),
('deposit', models.DecimalField(decimal_places=2, max_digits=8)),
('description', models.TextField()),
('barcode', models.CharField(blank=True, default=b'', max_length=100)),
],
),
migrations.CreateModel(
name='BuyableType',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Order',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('price', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=8)),
('dateTime', models.DateTimeField(auto_now_add=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Purchase',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('price', models.DecimalField(decimal_places=2, default=None, max_digits=8)),
('isDeposit', models.BooleanField()),
('buyable', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buyable.Buyable')),
('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='buyable.Order')),
],
),
migrations.AddField(
model_name='buyable',
name='buyableType',
field=models.ManyToManyField(to='buyable.BuyableType'),
),
]

View File

View File

@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-10-24 01:07
from __future__ import unicode_literals
from decimal import Decimal
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='Plugin',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=40)),
('author', models.CharField(max_length=40)),
('version', models.CharField(max_length=40)),
('descr', models.TextField(default=b'')),
('uniqueAuthblob', models.BooleanField(default=False)),
('userCanWriteAuthblob', models.BooleanField(default=True)),
('maxLinesPerAuthblob', models.IntegerField(default=0)),
('userCanReadAuthblob', models.BooleanField(default=True)),
('pluginCanWriteAuthblob', models.BooleanField(default=False)),
('pluginCanReadAuthblob', models.BooleanField(default=False)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='PluginPermission',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('authblob', models.TextField(default=b'')),
('plugin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Plugin')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='UserProfile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('balance', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=9)),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]

View File

View File

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-10-24 01:07
from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import transaction.validator
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Transaction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dateTime', models.DateTimeField(auto_now_add=True)),
('amount', models.DecimalField(decimal_places=2, max_digits=8, validators=[transaction.validator.validate_notZero])),
('checked', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='TransactionType',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('needsCheck', models.BooleanField(default=True)),
],
),
migrations.CreateModel(
name='VirtualTransaction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dateTime', models.DateTimeField(auto_now_add=True)),
('amount', models.DecimalField(decimal_places=2, max_digits=8, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name=b'Betrag')),
('comment', models.CharField(max_length=100, verbose_name=b'Verwendungszweck')),
('recipient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='receivedtransaction', to=settings.AUTH_USER_MODEL, verbose_name='Empf\xe4nger')),
('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
),
migrations.AddField(
model_name='transaction',
name='transactionType',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='transaction.TransactionType', verbose_name=b'Typ'),
),
migrations.AddField(
model_name='transaction',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]