Skip to content
Snippets Groups Projects
Verified Commit 0a4684e1 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Update project to new database schema

parent bdd31013
No related branches found
No related tags found
No related merge requests found
Pipeline #2573 passed
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)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment