Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
logs
*.log
*.local
*.tsbuildinfo
.eslintcache
Expand Down
35 changes: 17 additions & 18 deletions apps/backend/articles/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 5.2.9 on 2026-02-28 07:11
# Generated by Django 6.0.3 on 2026-04-05 01:37

import django.utils.timezone
import uuid
from django.db import migrations, models

Expand All @@ -17,9 +16,9 @@ class Migration(migrations.Migration):
name='ArticleEvent',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='ID')),
('annotation', models.TextField(blank=True, null=True, verbose_name='annotation')),
('event_type', models.IntegerField(choices=[(1, 'Submit'), (2, 'Withdraw'), (3, 'Approve'), (4, 'Reject'), (5, 'Unpublish'), (6, 'Delete')], verbose_name='event type')),
('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='created at')),
('annotation', models.TextField(blank=True, help_text='The annotation of the article event', null=True, verbose_name='annotation')),
('event_type', models.IntegerField(choices=[(1, 'Submit'), (2, 'Withdraw'), (3, 'Approve'), (4, 'Reject'), (5, 'Unpublish'), (6, 'Delete')], help_text='The event type of the article event', verbose_name='event type')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, help_text='The created DateTime of the article event', verbose_name='created at')),
],
options={
'verbose_name': 'article event',
Expand All @@ -31,11 +30,11 @@ class Migration(migrations.Migration):
name='ArticleSnapshot',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(db_index=True, default='', max_length=60, verbose_name='title')),
('content', models.JSONField(blank=True, default=dict, verbose_name='content')),
('content_hash', models.CharField(blank=True, db_index=True, default='', max_length=64, verbose_name='content hash')),
('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='created at')),
('moderation_status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Withdrawn'), (3, 'Approved'), (4, 'Rejected')], db_index=True, default=1, verbose_name='moderation status')),
('title', models.CharField(db_index=True, default='', help_text='The title of the article snapshot', max_length=60, verbose_name='title')),
('content', models.JSONField(blank=True, default=dict, help_text='The content of the article snapshot', verbose_name='content')),
('content_hash', models.CharField(blank=True, db_index=True, default='', help_text='The content hash of the article snapshot', max_length=64, verbose_name='content hash')),
('moderation_status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Withdrawn'), (3, 'Approved'), (4, 'Rejected')], db_index=True, default=1, help_text='The moderation status of the article snapshot', verbose_name='moderation status')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, help_text='The created DateTime of the article snapshot', verbose_name='created at')),
],
options={
'verbose_name': 'article snapshot',
Expand All @@ -46,11 +45,11 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='PublishedArticle',
fields=[
('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='created at')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
('updated_at', models.DateTimeField(auto_now=True, db_index=True, verbose_name='updated at')),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(db_index=True, default='', max_length=60, verbose_name='title')),
('content', models.JSONField(blank=True, default=dict, verbose_name='content')),
('title', models.CharField(db_index=True, default='', help_text='The title of the published article', max_length=60, verbose_name='title')),
('content', models.JSONField(blank=True, default=dict, help_text='The content of the published article', verbose_name='content')),
],
options={
'verbose_name': 'published article',
Expand All @@ -61,14 +60,14 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='SourceArticle',
fields=[
('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='created at')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
('updated_at', models.DateTimeField(auto_now=True, db_index=True, verbose_name='updated at')),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, verbose_name='ID')),
('is_deleted', models.BooleanField(db_index=True, default=False, verbose_name='deleted')),
('title', models.CharField(db_index=True, default='', max_length=60, verbose_name='title')),
('content', models.JSONField(blank=True, default=dict, verbose_name='content')),
('status', models.IntegerField(choices=[(0, 'Draft'), (1, 'Pending'), (2, 'Published'), (3, 'Rejected'), (4, 'Unpublished'), (5, 'Deleted')], db_index=True, default=0, verbose_name='status')),
('last_moderation_at', models.DateTimeField(blank=True, null=True, verbose_name='last moderation at')),
('title', models.CharField(db_index=True, default='', help_text='The title of the article', max_length=60, verbose_name='title')),
('content', models.JSONField(blank=True, default=dict, help_text='The content of the article', verbose_name='content')),
('status', models.IntegerField(choices=[(0, 'Draft'), (1, 'Pending'), (2, 'Published'), (3, 'Unpublished')], db_index=True, default=0, help_text='The status of the article', verbose_name='status')),
('last_moderation_at', models.DateTimeField(blank=True, help_text='The last moderation DateTime of the article', null=True, verbose_name='last moderation at')),
],
options={
'verbose_name': 'source article',
Expand Down
14 changes: 7 additions & 7 deletions apps/backend/articles/migrations/0002_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.2.9 on 2026-02-28 07:11
# Generated by Django 6.0.3 on 2026-04-05 01:37

import django.db.models.deletion
from django.conf import settings
Expand All @@ -18,32 +18,32 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='articleevent',
name='actor',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='article_events_actors', to=settings.AUTH_USER_MODEL, verbose_name='actor'),
field=models.ForeignKey(help_text='The actor of the article event', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='article_events', to=settings.AUTH_USER_MODEL, verbose_name='actor'),
),
migrations.AddField(
model_name='articleevent',
name='article_snapshot',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='related_events', to='articles.articlesnapshot', verbose_name='snapshot'),
field=models.ForeignKey(help_text='The article snapshot of the article event', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='article_events', to='articles.articlesnapshot', verbose_name='snapshot'),
),
migrations.AddField(
model_name='sourcearticle',
name='author',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='source_articles', to=settings.AUTH_USER_MODEL, verbose_name='author'),
field=models.ForeignKey(help_text='The author of the article', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='source_articles', to=settings.AUTH_USER_MODEL, verbose_name='author'),
),
migrations.AddField(
model_name='publishedarticle',
name='source_article',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='published_version', to='articles.sourcearticle', verbose_name='source article'),
field=models.OneToOneField(help_text='The source article of the published version', on_delete=django.db.models.deletion.CASCADE, related_name='published_version', to='articles.sourcearticle', verbose_name='source article'),
),
migrations.AddField(
model_name='articlesnapshot',
name='source_article',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='article_snapshots', to='articles.sourcearticle', verbose_name='source article'),
field=models.ForeignKey(help_text='The source article of the article snapshot', on_delete=django.db.models.deletion.CASCADE, related_name='article_snapshots', to='articles.sourcearticle', verbose_name='source article'),
),
migrations.AddField(
model_name='articleevent',
name='source_article',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='article_events', to='articles.sourcearticle', verbose_name='source articles'),
field=models.ForeignKey(help_text='The source article of the article event', on_delete=django.db.models.deletion.CASCADE, related_name='article_events', to='articles.sourcearticle', verbose_name='source articles'),
),
migrations.AddIndex(
model_name='sourcearticle',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Generated by Django 6.0.3 on 2026-04-05 12:34

import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('articles', '0002_initial'),
]

operations = [
migrations.AlterField(
model_name='articleevent',
name='id',
field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='The UUID of the object', primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='articlesnapshot',
name='id',
field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='The UUID of the object', primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='publishedarticle',
name='created_at',
field=models.DateTimeField(auto_now_add=True, db_index=True, help_text='The created DateTime of the object', verbose_name='created at'),
),
migrations.AlterField(
model_name='publishedarticle',
name='id',
field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='The UUID of the object', primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='publishedarticle',
name='updated_at',
field=models.DateTimeField(auto_now=True, db_index=True, help_text='The updated DateTime of the object', verbose_name='updated at'),
),
migrations.AlterField(
model_name='sourcearticle',
name='created_at',
field=models.DateTimeField(auto_now_add=True, db_index=True, help_text='The created DateTime of the object', verbose_name='created at'),
),
migrations.AlterField(
model_name='sourcearticle',
name='id',
field=models.UUIDField(default=uuid.uuid4, editable=False, help_text='The UUID of the object', primary_key=True, serialize=False, verbose_name='ID'),
),
migrations.AlterField(
model_name='sourcearticle',
name='is_deleted',
field=models.BooleanField(db_index=True, default=False, help_text='Whether the object is deleted', verbose_name='deleted'),
),
migrations.AlterField(
model_name='sourcearticle',
name='updated_at',
field=models.DateTimeField(auto_now=True, db_index=True, help_text='The updated DateTime of the object', verbose_name='updated at'),
),
]
Loading
Loading