schon/blog/migrations/0001_initial.py

54 lines
3.1 KiB
Python

# Generated by Django 5.1.8 on 2025-04-28 11:56
import django.db.models.deletion
import django_extensions.db.fields
import markdown_field.fields
import uuid
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='PostTag',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='unique id is used to surely identify any database object', primary_key=True, serialize=False, verbose_name='unique id')),
('is_active', models.BooleanField(default=True, help_text="if set to false, this object can't be seen by users without needed permission", verbose_name='is active')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, help_text='when the object first appeared on the database', verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, help_text='when the object was last modified', verbose_name='modified')),
('tag_name', models.CharField(help_text='internal tag identifier for the post tag', max_length=255, verbose_name='tag name')),
('name', models.CharField(help_text='user-friendly name for the post tag', max_length=255, unique=True, verbose_name='tag display name')),
],
options={
'verbose_name': 'post tag',
'verbose_name_plural': 'post tags',
},
),
migrations.CreateModel(
name='Post',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='unique id is used to surely identify any database object', primary_key=True, serialize=False, verbose_name='unique id')),
('is_active', models.BooleanField(default=True, help_text="if set to false, this object can't be seen by users without needed permission", verbose_name='is active')),
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, help_text='when the object first appeared on the database', verbose_name='created')),
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, help_text='when the object was last modified', verbose_name='modified')),
('title', models.CharField()),
('content', markdown_field.fields.MarkdownField(blank=True, null=True, verbose_name='content')),
('file', models.FileField(blank=True, null=True, upload_to='posts/')),
('slug', models.SlugField(allow_unicode=True)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to=settings.AUTH_USER_MODEL)),
('tags', models.ManyToManyField(to='blog.posttag')),
],
options={
'verbose_name': 'post',
'verbose_name_plural': 'posts',
},
),
]