django_pfm/pfm/migrations/0001_initial.py
2017-10-31 16:37:02 +03:00

71 lines
3.8 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-02 10:08
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
import django.utils.timezone
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')),
('acc_name', models.CharField(max_length=50, verbose_name='Account')),
('acc_balance', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Balance')),
('acc_currency', models.CharField(max_length=3, verbose_name='Currency')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cat_name', models.CharField(max_length=50, verbose_name='Category')),
('budget_type', models.CharField(choices=[('W', 'Weekly'), ('M', 'Monthly'), ('Y', 'Yearly')], default='W', max_length=1, verbose_name='Type')),
('budget_amount', models.DecimalField(decimal_places=2, default=0, max_digits=10, verbose_name='Amount')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Categories',
},
),
migrations.CreateModel(
name='Transaction',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('tr_type', models.CharField(choices=[('I', 'Income'), ('E', 'Expence')], default='E', max_length=1, verbose_name='Type')),
('tr_amount', models.DecimalField(decimal_places=2, default='0,00', max_digits=10, verbose_name='Amount')),
('tr_note', models.CharField(blank=True, max_length=100, null=True)),
('tr_date', models.DateField(default=datetime.datetime(2016, 10, 2, 10, 8, 39, 110793, tzinfo=utc))),
('pub_date', models.DateTimeField(blank=True, null=True)),
('tr_acc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pfm.Account')),
('tr_cat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pfm.Category')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Transfer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('tr_amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Amount')),
('tr_date', models.DateTimeField(default=django.utils.timezone.now)),
('from_acc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='to_acc', to='pfm.Account')),
('to_acc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='from_acc', to='pfm.Account')),
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]