From 2b45926f326785ac2f2625e2a9c820999cc3152e Mon Sep 17 00:00:00 2001 From: slhmy <1484836413@qq.com> Date: Sat, 9 Sep 2023 17:54:33 +0800 Subject: [PATCH] Add default problem --- migration/migrate_db.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/migration/migrate_db.go b/migration/migrate_db.go index 54305e5..abab984 100644 --- a/migration/migrate_db.go +++ b/migration/migrate_db.go @@ -2,6 +2,7 @@ package main import ( "github.com/OJ-lab/oj-lab-services/packages/application" + "github.com/OJ-lab/oj-lab-services/packages/mapper" "github.com/OJ-lab/oj-lab-services/packages/model" "github.com/sirupsen/logrus" ) @@ -12,5 +13,12 @@ func main() { if err != nil { panic("failed to migrate database") } + + mapper.CreateProblem(model.Problem{ + Slug: "hello-world", + Title: "Hello! { ... }", + Description: `Write a program that prints "Hello! %s" to the standard output (stdout).`, + }) + logrus.Info("migrate tables success") }