kumify/mood/migrations/0001_initial.py
Kumi 4aa4af9613
feat: Add initial migrations for GPS and Mood modules
Introduced initial database migrations for GPS logging and Mood tracking functionality, setting the foundation for data model structures in these modules. The migrations define essential entities such as GPSTrack, GPSToken, GPSPoint for the GPS logging module, and Mood, Activity, Aspect among others for the Mood tracking module. This pivotal change enables storing and managing user-generated GPS and mood data efficiently, paving the way for the implementation of core features related to GPS tracking and mood analysis. By removing 'migrations/' from .gitignore, we ensure future migrations are tracked and version-controlled, facilitating smoother database schema updates and deployments.
2024-05-17 13:27:49 +02:00

119 lines
6.1 KiB
Python

# 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')),
],
),
]