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
1 changed files with 5 additions and 5 deletions

View File

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