kumify/mood/migrations/0001_initial.py

120 lines
6.1 KiB
Python
Raw Normal View History

# Generated by Django 5.0.6 on 2024-05-17 11:27
import colorfield.fields
import common.helpers
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
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='ActivityCategory',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('icon', models.CharField(default='fas fa-check', max_length=64)),
('color', colorfield.fields.ColorField(default='#000000', image_field=None, max_length=25, samples=None)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Activity',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('icon', models.CharField(default='fas fa-check', max_length=64)),
('color', colorfield.fields.ColorField(default='#000000', image_field=None, max_length=25, samples=None)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mood.activitycategory')),
],
options={
'ordering': ['name'],
},
),
migrations.CreateModel(
name='Aspect',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('icon', models.CharField(blank=True, max_length=64, null=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='AspectRating',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('icon', models.CharField(default='fas fa-star', max_length=64)),
('color', colorfield.fields.ColorField(default='#000000', image_field=None, max_length=25, samples=None)),
('value', models.IntegerField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(255)])),
('aspect', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mood.aspect')),
],
),
migrations.CreateModel(
name='Mood',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64)),
('icon', models.CharField(default='fas fa-star', max_length=64)),
('color', colorfield.fields.ColorField(default='#000000', image_field=None, max_length=25, samples=None)),
('value', models.IntegerField(validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(255)])),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['-value'],
},
),
migrations.CreateModel(
name='Status',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
('title', models.CharField(blank=True, max_length=64, null=True)),
('text', models.TextField(blank=True, null=True)),
('mood', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mood.mood')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'ordering': ['timestamp'],
},
),
migrations.CreateModel(
name='StatusActivity',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True, null=True)),
('activity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mood.activity')),
('status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mood.status')),
],
),
migrations.CreateModel(
name='StatusAspectRating',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True, null=True)),
('aspect_rating', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='mood.aspectrating')),
('status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mood.status')),
],
),
migrations.CreateModel(
name='StatusMedia',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(upload_to='', verbose_name=common.helpers.get_upload_path)),
('status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mood.status')),
],
),
]