1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00

Fix paste saving SQL query

This commit is contained in:
Lukas Schulte Pelkum 2021-07-22 23:33:19 +02:00
parent 9eaf9c3053
commit 149abf77f1
No known key found for this signature in database
GPG Key ID: 408DA7CA81DB885C

View File

@ -94,13 +94,13 @@ func (driver *PostgresDriver) Get(id string) (*shared.Paste, error) {
// Save saves a paste
func (driver *PostgresDriver) Save(paste *shared.Paste) error {
query := `
INSERT INTO pastes (id, content, modificationToken, created, autoDelete)
VALUES ($1, $2, $3, $4, $5)
INSERT INTO pastes (id, content, "modificationToken", created, "autoDelete", metadata)
VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (id) DO UPDATE
SET content = excluded.token,
modificationToken = excluded.modificationToken,
SET content = excluded.content,
"modificationToken" = excluded."modificationToken",
created = excluded.created,
autoDelete = excluded.autoDelete,
"autoDelete" = excluded."autoDelete",
metadata = excluded.metadata
`