kumify/dreams/migrations/0001_initial.py

83 lines
4.1 KiB
Python
Raw Normal View History

# Generated by Django 5.0.6 on 2024-05-17 11:28
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 = [
('mood', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Dream',
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(max_length=64)),
('content', models.TextField()),
('type', models.IntegerField(choices=[(0, 'Night (main) sleep'), (1, 'Daydream'), (2, 'Napping')])),
('lucid', models.BooleanField(default=False)),
('wet', models.BooleanField(default=False)),
('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)),
],
),
migrations.CreateModel(
name='DreamMedia',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('media', models.FileField(upload_to='', verbose_name=common.helpers.get_upload_path)),
('dream', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dreams.dream')),
],
),
migrations.CreateModel(
name='Theme',
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-bed', 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='DreamTheme',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('dream', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dreams.dream')),
('theme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dreams.theme')),
],
),
migrations.CreateModel(
name='ThemeRating',
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)])),
('theme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dreams.theme')),
],
),
migrations.CreateModel(
name='DreamThemeRating',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('comment', models.TextField(blank=True, null=True)),
('dream', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dreams.dream')),
('theme_rating', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='dreams.themerating')),
],
),
]