Files
my2dos/core/migrations/0001_initial.py
2026-08-22 13:45:40 +02:00

46 lines
2.3 KiB
Python

# Generated for my2dos MVP
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='Tag',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.SlugField(allow_unicode=True, max_length=80, unique=True)),
],
options={'ordering': ['name']},
),
migrations.CreateModel(
name='Item',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('kind', models.CharField(choices=[('todo', 'Aufgabe'), ('note', 'Notiz'), ('link', 'Link')], default='note', max_length=10)),
('content', models.TextField()),
('visibility', models.CharField(choices=[('private', 'Privat'), ('public', 'Öffentlich')], default='private', max_length=10)),
('is_done', models.BooleanField(default=False)),
('url', models.URLField(blank=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
('linked_items', models.ManyToManyField(blank=True, related_name='backlinks', to='core.item')),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to=settings.AUTH_USER_MODEL)),
('tags', models.ManyToManyField(blank=True, related_name='items', to='core.tag')),
],
options={'ordering': ['-created_at']},
),
migrations.CreateModel(
name='Attachment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('file', models.FileField(upload_to='attachments/%Y/%m/')),
('uploaded_at', models.DateTimeField(auto_now_add=True)),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='core.item')),
],
),
]