Aureon / finance /migrations /0001_initial.py
CineDev's picture
feat: add initial finance migration
fe64fb3
Raw
History Blame Contribute Delete
4.97 kB
# Generated by Django 6.0.2 on 2026-05-17 14:03
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Budget',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('category_key', models.CharField(max_length=50)),
('budget_amount', models.DecimalField(decimal_places=2, max_digits=12)),
('spent_amount', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
('remaining_amount', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
('status', models.CharField(default='good', max_length=50)),
('warning_message', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='budgets', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Goal',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('current_amount', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
('target_amount', models.DecimalField(decimal_places=2, max_digits=12)),
('deadline', models.DateField(blank=True, null=True)),
('monthly_target', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
('priority', models.CharField(default='medium', max_length=50)),
('category', models.CharField(blank=True, max_length=100, null=True)),
('auto_save', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='goals', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Subscription',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('amount', models.DecimalField(decimal_places=2, max_digits=10)),
('renewal_date', models.DateField(blank=True, null=True)),
('usage_level', models.CharField(default='Medium', max_length=50)),
('value_score', models.IntegerField(default=3)),
('status', models.CharField(default='active', max_length=50)),
('last_used_date', models.DateField(blank=True, null=True)),
('warning', models.TextField(blank=True, null=True)),
('potential_saving', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Transaction',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField()),
('merchant', models.CharField(max_length=255)),
('amount', models.DecimalField(decimal_places=2, max_digits=12)),
('category', models.CharField(max_length=100)),
('category_key', models.CharField(max_length=50)),
('time', models.TimeField(blank=True, null=True)),
('payment_method', models.CharField(blank=True, max_length=100, null=True)),
('note', models.TextField(blank=True, null=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transactions', to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-date', '-time', '-created_at'],
},
),
]