From 0a4684e1c69165f4fae53988aa7dd91bd8de5226 Mon Sep 17 00:00:00 2001
From: Janne Mareike Koschinski <janne@kuschku.de>
Date: Tue, 27 Jul 2021 20:30:54 +0200
Subject: [PATCH] Update project to new database schema

---
 page_upload.go | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/page_upload.go b/page_upload.go
index 23154e6..d91052a 100644
--- a/page_upload.go
+++ b/page_upload.go
@@ -1,16 +1,16 @@
 package main
 
 import (
-	"net/http"
-	"fmt"
-	"time"
+	"crypto/rand"
+	"encoding/base64"
 	"encoding/json"
+	"fmt"
 	"io"
 	"mime/multipart"
-	"path/filepath"
+	"net/http"
 	"os"
-	"encoding/base64"
-	"crypto/rand"
+	"path/filepath"
+	"time"
 )
 
 type UploadData struct {
@@ -114,7 +114,7 @@ func pageUpload(ctx PageContext) http.Handler {
 			}
 
 			pubsub := ctx.Redis.Subscribe(ctx.Config.ResultChannel)
-			_, err = ctx.Database.Exec("INSERT INTO images (id, owner, created_at, original_name, type) VALUES ($1, $2, $3, $4, $5)", image.Id, user.Id, image.CreatedAt, image.OriginalName, image.MimeType)
+			_, err = ctx.Database.Exec("INSERT INTO images (id, owner, created_at, updated_at, original_name, type) VALUES ($1, $2, $3, $4, $5)", image.Id, user.Id, image.CreatedAt, image.CreatedAt, image.OriginalName, image.MimeType)
 			if err != nil {
 				panic(err)
 			}
-- 
GitLab