Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix migration conflict #454

Merged
merged 1 commit into from
Mar 6, 2024
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
33 changes: 0 additions & 33 deletions apps/core/migrations/0044_portalviewcount.py

This file was deleted.

22 changes: 0 additions & 22 deletions apps/core/migrations/0045_article_add_latest_portal_view_count.py

This file was deleted.

29 changes: 0 additions & 29 deletions apps/core/migrations/0046_alter_portal_crawl_related_field.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Generated by Django 4.2.9 on 2024-03-06 07:05

import datetime

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


class Migration(migrations.Migration):
dependencies = [
("core", "0057_alter_article_name_type_and_more"),
]

operations = [
migrations.AddField(
model_name="article",
name="latest_portal_view_count",
field=models.PositiveIntegerField(
blank=True, default=None, null=True, verbose_name="포탈 조회수"
),
),
migrations.AlterField(
model_name="article",
name="url",
field=models.URLField(
blank=True,
db_index=True,
default=None,
max_length=256,
null=True,
verbose_name="포탈 링크",
),
),
migrations.CreateModel(
name="PortalViewCount",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"created_at",
models.DateTimeField(
db_index=True,
default=django.utils.timezone.now,
verbose_name="생성 시간",
),
),
(
"updated_at",
models.DateTimeField(
auto_now=True, db_index=True, verbose_name="수정 시간"
),
),
(
"deleted_at",
models.DateTimeField(
db_index=True,
default=datetime.datetime(
1, 1, 1, 0, 0, tzinfo=datetime.timezone.utc
),
verbose_name="삭제 시간",
),
),
(
"view_count",
models.PositiveIntegerField(default=0, verbose_name="조회수"),
),
(
"article",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="게시물",
to="core.article",
),
),
],
options={
"ordering": ("-created_at",),
"abstract": False,
},
),
]
12 changes: 0 additions & 12 deletions apps/core/migrations/0058_merge_20240109_2331.py

This file was deleted.

10 changes: 5 additions & 5 deletions apps/core/models/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ class Article(MetaDataModel):
)

url = models.URLField(
null=True,
blank=True,
default=None,
verbose_name="포탈 링크",
max_length=256,
blank=True,
null=True,
db_index=True,
default=None,
)

latest_portal_view_count = models.PositiveIntegerField(
null=True,
verbose_name="포탈 조회수",
blank=True,
null=True,
default=None,
verbose_name="포탈조회수",
)

content_updated_at = models.DateTimeField(
Expand Down
15 changes: 5 additions & 10 deletions apps/core/models/portal_view_count.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
from django.db import models

from ara.db.models import MetaDataModel
from django.utils import timezone


class PortalViewCount(MetaDataModel):
article = models.ForeignKey(
on_delete=models.CASCADE,
to="core.Article",
null=False,
on_delete=models.CASCADE,
related_name="게시물",
null=False,
)

view_count = models.IntegerField(
view_count = models.PositiveIntegerField(
verbose_name="조회수",
default=0,
verbose_name="조회수 값",
)

created_at = models.DateTimeField(
default=timezone.now,
verbose_name="생성 시간",
)
Loading