Compare commits

...

2 Commits

Author SHA1 Message Date
d91750ca0f
drop extensions table 2022-01-08 19:45:19 +01:00
d6bf20028d
Fixed prepared statement for extensions 2022-01-08 19:45:00 +01:00
2 changed files with 4 additions and 7 deletions

View File

@ -27,6 +27,7 @@ SELECT _v.unregister_patch('exchange-0001');
-- Drops for exchange-0001.sql -- Drops for exchange-0001.sql
DROP TABLE IF EXISTS revolving_work_shards CASCADE; DROP TABLE IF EXISTS revolving_work_shards CASCADE;
DROP TABLE IF EXISTS extensions CASCADE;
DROP TABLE IF EXISTS auditors CASCADE; DROP TABLE IF EXISTS auditors CASCADE;
DROP TABLE IF EXISTS auditor_denom_sigs CASCADE; DROP TABLE IF EXISTS auditor_denom_sigs CASCADE;
DROP TABLE IF EXISTS exchange_sign_keys CASCADE; DROP TABLE IF EXISTS exchange_sign_keys CASCADE;

View File

@ -2746,13 +2746,9 @@ prepare_statements (struct PostgresClosure *pg)
/* Used in #postgres_set_extension_config */ /* Used in #postgres_set_extension_config */
GNUNET_PQ_make_prepare ( GNUNET_PQ_make_prepare (
"set_extension_config", "set_extension_config",
"WITH upsert AS " "INSERT INTO extensions (name, config, config_sig) VALUES ($1, $2, $3) "
" (UPDATE extensions " "ON CONFLICT (name) "
" SET config=$2 " "DO UPDATE SET (config, config_sig) = ($2, $3)",
" config_sig=$3 "
" WHERE name=$1 RETURNING *) "
"INSERT INTO extensions (config, config_sig) VALUES ($2, $3) "
"WHERE NOT EXISTS (SELECT * FROM upsert);",
3), 3),
/* Used in #postgres_get_extension_config */ /* Used in #postgres_get_extension_config */
GNUNET_PQ_make_prepare ( GNUNET_PQ_make_prepare (