reinvest/backend/api/migrations/0001_initial.py

60 lines
2.6 KiB
Python

# Generated by Django 3.1.5 on 2021-01-30 20:48
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='Charity',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ein', models.CharField(blank=True, max_length=50, null=True)),
('name', models.CharField(blank=True, max_length=50, null=True)),
('sub_name', models.CharField(blank=True, max_length=50, null=True)),
('city', models.CharField(blank=True, max_length=20, null=True)),
('state', models.CharField(blank=True, max_length=2, null=True)),
],
options={
'verbose_name_plural': 'Charities',
},
),
migrations.CreateModel(
name='Profile',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('nickname', models.CharField(blank=True, max_length=20, null=True)),
('profile_pic', models.ImageField(default='default.jpg', upload_to='profile_pics')),
('percentage', models.DecimalField(decimal_places=2, max_digits=3)),
('charity', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api.charity')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Profiles',
},
),
migrations.CreateModel(
name='Stock',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('ticker', models.CharField(blank=True, max_length=5, null=True)),
('buy_price', models.DecimalField(decimal_places=2, max_digits=9)),
('quantity', models.DecimalField(decimal_places=2, max_digits=9)),
('uuid', models.UUIDField(editable=False, unique=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stock', to='api.profile')),
],
options={
'verbose_name_plural': 'Stocks',
},
),
]