Your one-stop-cake-shop for everything Freshly Baked has to offer

feat(menu): allow overwriting links

Previously when a link was put into menu it was impossible to overwrite
it without editing the database. Instead, we can change our INSERT to
an UPSERT to allow that. This lets me fix typos (such as y/bsky missing
the /profile/ path)

-16
menu/.sqlx/query-735cda2fe387b6b852a03ba7ccba41353667bd505f80c1cfe3ad16b738b45ba5.json
··· 1 - { 2 - "db_name": "PostgreSQL", 3 - "query": "INSERT INTO direct (\"from\", \"to\", \"owner\") VALUES ($1, $2, $3)", 4 - "describe": { 5 - "columns": [], 6 - "parameters": { 7 - "Left": [ 8 - "Varchar", 9 - "Varchar", 10 - "Varchar" 11 - ] 12 - }, 13 - "nullable": [] 14 - }, 15 - "hash": "735cda2fe387b6b852a03ba7ccba41353667bd505f80c1cfe3ad16b738b45ba5" 16 - }
+16
menu/.sqlx/query-9eecf9b43e5458bc95fc45fe8e48d6da5edb50cdbf1e7a478faf310d6b9022ad.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "INSERT INTO direct (\"from\", \"to\", \"owner\") VALUES ($1, $2, $3) ON CONFLICT (\"from\") DO UPDATE SET \"to\" = EXCLUDED.to, \"owner\" = EXCLUDED.owner", 4 + "describe": { 5 + "columns": [], 6 + "parameters": { 7 + "Left": [ 8 + "Varchar", 9 + "Varchar", 10 + "Varchar" 11 + ] 12 + }, 13 + "nullable": [] 14 + }, 15 + "hash": "9eecf9b43e5458bc95fc45fe8e48d6da5edb50cdbf1e7a478faf310d6b9022ad" 16 + }
+1 -1
menu/src/main.rs
··· 139 139 }; 140 140 141 141 let create_call = sqlx::query!( 142 - r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3)"#, 142 + r#"INSERT INTO direct ("from", "to", "owner") VALUES ($1, $2, $3) ON CONFLICT ("from") DO UPDATE SET "to" = EXCLUDED.to, "owner" = EXCLUDED.owner"#, 143 143 create.from.to_lowercase(), 144 144 create.to, 145 145 owner,