diff --git a/rog/models.py b/rog/models.py index 782c394..a3a7f1a 100644 --- a/rog/models.py +++ b/rog/models.py @@ -547,7 +547,7 @@ class GpsCheckin(models.Model): null=False, help_text="ゼッケン番号" ) - event_id = models.TextField( + event_id = models.IntegerField( null=True, blank=True, help_text="イベントID" diff --git a/rog/postgres_views.sql b/rog/postgres_views.sql index 13e82fb..e96d184 100644 --- a/rog/postgres_views.sql +++ b/rog/postgres_views.sql @@ -6,6 +6,7 @@ DROP VIEW IF EXISTS v_checkin_summary CASCADE; -- チェックポイントの集計用ビュー CREATE VIEW v_checkin_summary AS SELECT + event_id, event_code, zekken_number, -- 文字列として保持 COUNT(*) as total_checkins, @@ -18,7 +19,7 @@ SELECT FROM gps_checkins GROUP BY - event_code, zekken_number; + event_id,event_code, zekken_number; -- カテゴリー内ランキング計算用ビュー CREATE VIEW v_category_rankings AS