From 679b4170981086b3717af3149ea14c33b4bdf641 Mon Sep 17 00:00:00 2001 From: hyukychang Date: Thu, 14 Nov 2024 22:22:34 +0900 Subject: [PATCH 1/3] feat: add index for topped at --- .../0059_alter_article_topped_at.py | 23 +++++++++++++++++++ apps/core/models/article.py | 1 + ara/settings/dev/__init__.py | 4 ++++ 3 files changed, 28 insertions(+) create mode 100644 apps/core/migrations/0059_alter_article_topped_at.py diff --git a/apps/core/migrations/0059_alter_article_topped_at.py b/apps/core/migrations/0059_alter_article_topped_at.py new file mode 100644 index 00000000..0c169974 --- /dev/null +++ b/apps/core/migrations/0059_alter_article_topped_at.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.11 on 2024-11-14 13:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("core", "0058_article_latest_portal_view_count_alter_article_url_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="article", + name="topped_at", + field=models.DateTimeField( + blank=True, + db_index=True, + default=None, + null=True, + verbose_name="인기글 달성 시각", + ), + ), + ] diff --git a/apps/core/models/article.py b/apps/core/models/article.py index 79f896d5..1dd93712 100644 --- a/apps/core/models/article.py +++ b/apps/core/models/article.py @@ -166,6 +166,7 @@ class Article(MetaDataModel): blank=True, null=True, default=None, + db_index=True, ) class Meta(MetaDataModel.Meta): diff --git a/ara/settings/dev/__init__.py b/ara/settings/dev/__init__.py index 232ed794..5eeb1206 100644 --- a/ara/settings/dev/__init__.py +++ b/ara/settings/dev/__init__.py @@ -1,10 +1,14 @@ import socket from datetime import datetime, timezone +import pymysql + from ara.settings import INSTALLED_APPS, LOGGING, MIDDLEWARE from ..djangorestframework import REST_FRAMEWORK +pymysql.install_as_MySQLdb() + DEBUG = True ALLOWED_HOSTS = ["*"] From 43102b2c57ca83c7c6f5353984edeb3f15c03408 Mon Sep 17 00:00:00 2001 From: hyukychang Date: Thu, 21 Nov 2024 22:18:09 +0900 Subject: [PATCH 2/3] fix: github action docker-compose command not found --- .github/workflows/github-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 9064444a..077062d1 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -56,8 +56,8 @@ jobs: - name: Run test run: | - docker-compose -f docker-compose.test.yml run api test - docker-compose -f docker-compose.test.yml down + docker compose -f docker-compose.test.yml run api test + docker compose -f docker-compose.test.yml down - if: env.PUSH == 'true' name: Push docker image run: | From ba7fb7da21caf59911a48e7459f99800a14e0d8c Mon Sep 17 00:00:00 2001 From: hyukychang Date: Thu, 21 Nov 2024 22:23:22 +0900 Subject: [PATCH 3/3] fix: remove unnecessary import --- ara/settings/dev/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ara/settings/dev/__init__.py b/ara/settings/dev/__init__.py index 5eeb1206..232ed794 100644 --- a/ara/settings/dev/__init__.py +++ b/ara/settings/dev/__init__.py @@ -1,14 +1,10 @@ import socket from datetime import datetime, timezone -import pymysql - from ara.settings import INSTALLED_APPS, LOGGING, MIDDLEWARE from ..djangorestframework import REST_FRAMEWORK -pymysql.install_as_MySQLdb() - DEBUG = True ALLOWED_HOSTS = ["*"]