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:
parent
9eaf9c3053
commit
149abf77f1
@ -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
|
||||||
`
|
`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user