72 lines
3.3 KiB
Python
72 lines
3.3 KiB
Python
# Generated by Django 5.2.7 on 2026-04-14 16:42
|
|
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='NewsSource',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=120, unique=True)),
|
|
('slug', models.SlugField(max_length=140, unique=True)),
|
|
('site_url', models.URLField(blank=True)),
|
|
('feed_url', models.URLField(unique=True)),
|
|
('description', models.TextField(blank=True)),
|
|
('is_active', models.BooleanField(default=True)),
|
|
('last_synced_at', models.DateTimeField(blank=True, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
options={
|
|
'ordering': ['name'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Topic',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=80, unique=True)),
|
|
('slug', models.SlugField(max_length=90, unique=True)),
|
|
('description', models.TextField(blank=True)),
|
|
('accent_color', models.CharField(default='#00c2a8', max_length=7)),
|
|
],
|
|
options={
|
|
'ordering': ['name'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Article',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('title', models.CharField(max_length=220)),
|
|
('slug', models.SlugField(max_length=240, unique=True)),
|
|
('excerpt', models.TextField(blank=True)),
|
|
('content', models.TextField(blank=True)),
|
|
('article_kind', models.CharField(choices=[('rss', 'RSS import'), ('original', 'Original story')], default='rss', max_length=20)),
|
|
('external_url', models.URLField(blank=True)),
|
|
('image_url', models.URLField(blank=True)),
|
|
('author_name', models.CharField(blank=True, max_length=120)),
|
|
('published_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('dedupe_key', models.CharField(blank=True, max_length=64, unique=True)),
|
|
('is_featured', models.BooleanField(default=False)),
|
|
('is_published', models.BooleanField(default=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('source', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='core.newssource')),
|
|
('topic', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='articles', to='core.topic')),
|
|
],
|
|
options={
|
|
'ordering': ['-published_at', '-created_at'],
|
|
},
|
|
),
|
|
]
|