From 2d7d6a2f8b90b3c11ffefca3674688ca73e3d161 Mon Sep 17 00:00:00 2001 From: Kato Twofold Date: Wed, 18 May 2022 22:49:18 +0300 Subject: [PATCH] * Various tries to fix --- Dockerfile | 2 +- src/routes/routes_api.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ef5f4d3..23b654d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM alpine -LABEL version="1.4.0" +LABEL version="1.5.1" # Copy the distribution files COPY ./dist /app diff --git a/src/routes/routes_api.go b/src/routes/routes_api.go index d9d5aed..c9d3482 100644 --- a/src/routes/routes_api.go +++ b/src/routes/routes_api.go @@ -7,6 +7,7 @@ import ( "github.com/JustKato/FreePad/controllers/post" "github.com/JustKato/FreePad/helper" + "github.com/JustKato/FreePad/models/database" "github.com/JustKato/FreePad/types" "github.com/gin-gonic/gin" "github.com/skip2/go-qrcode" @@ -23,6 +24,14 @@ func ApiRoutes(route *gin.RouterGroup) { // Get the content of the post postContent := ctx.PostForm("content") + // Try and run migrations + err := database.MigrateMysql() + if err != nil { + fmt.Println("Error") + fmt.Println(err) + fmt.Println("Error") + } + // Create my post myPost, err := post.Create(postName, postContent) if err != nil {