feat: Attachment 모델 추가 및 관련 기능 구현
All checks were successful
Build And Test / build-and-push (push) Successful in 2m5s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 23:39:05 +09:00
parent 362412f0c9
commit dfecaa7654
9 changed files with 447 additions and 7 deletions

View File

@ -0,0 +1,25 @@
# Generated by Django 4.2.14 on 2026-01-20 13:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_tag_post_tags'),
]
operations = [
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/%d/')),
('original_name', models.CharField(max_length=255)),
('file_size', models.PositiveIntegerField()),
('uploaded_at', models.DateTimeField(auto_now_add=True)),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='blog.post')),
],
),
]

View File

@ -0,0 +1,29 @@
# Generated by Django 4.2.14 on 2026-01-20 14:07
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_attachment'),
]
operations = [
migrations.AddField(
model_name='attachment',
name='uploader_id',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AddField(
model_name='attachment',
name='uploader_name',
field=models.CharField(blank=True, default='', max_length=150),
),
migrations.AlterField(
model_name='attachment',
name='post',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='blog.post'),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.14 on 2026-01-20 14:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_attachment_uploader_id_attachment_uploader_name_and_more'),
]
operations = [
migrations.AddField(
model_name='attachment',
name='batch_id',
field=models.CharField(blank=True, default='', max_length=36),
),
]