summaryrefslogtreecommitdiff
path: root/src/syncdb
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-17 21:14:29 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-17 21:14:29 +0100
commit386aee464494ff6dfb6d7b51825e398ef1462ba9 (patch)
tree01735a52efa76a961bd84e1d33845782ceb20631 /src/syncdb
parentc96c9e1656e86c059ab5e8ce239783fc8cbebda7 (diff)
downloadsync-386aee464494ff6dfb6d7b51825e398ef1462ba9.tar.gz
sync-386aee464494ff6dfb6d7b51825e398ef1462ba9.tar.bz2
sync-386aee464494ff6dfb6d7b51825e398ef1462ba9.zip
sql fixes
Diffstat (limited to 'src/syncdb')
-rw-r--r--src/syncdb/plugin_syncdb_postgres.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/syncdb/plugin_syncdb_postgres.c b/src/syncdb/plugin_syncdb_postgres.c
index 7cef697..475109f 100644
--- a/src/syncdb/plugin_syncdb_postgres.c
+++ b/src/syncdb/plugin_syncdb_postgres.c
@@ -1023,7 +1023,7 @@ libsync_plugin_db_postgres_init (void *cls)
",expiration_date INT8 NOT NULL"
");"),
GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS payments"
- "(account_pub BYTEA CHECK (length(account_pub)=32),"
+ "(account_pub BYTEA CHECK (length(account_pub)=32)"
",order_id VARCHAR PRIMARY KEY"
",timestamp INT8 NOT NULL"
",amount_val INT8 NOT NULL" /* amount we were paid */
@@ -1049,7 +1049,7 @@ libsync_plugin_db_postgres_init (void *cls)
struct GNUNET_PQ_PreparedStatement ps[] = {
GNUNET_PQ_make_prepare ("account_insert",
"INSERT INTO accounts "
- "(account_pub,"
+ "(account_pub"
",expiration_date"
") VALUES "
"($1,$2);",
@@ -1096,10 +1096,8 @@ libsync_plugin_db_postgres_init (void *cls)
",order_id"
",amount_val"
",amount_frac"
- "FROM"
- " payments "
- "WHERE"
- " paid=FALSE;",
+ " FROM payments"
+ " WHERE paid=FALSE;",
0),
GNUNET_PQ_make_prepare ("payments_select_by_account",
"SELECT"
@@ -1107,9 +1105,8 @@ libsync_plugin_db_postgres_init (void *cls)
",order_id"
",amount_val"
",amount_frac"
- "FROM"
- " payments "
- "WHERE"
+ " FROM payments"
+ " WHERE"
" paid=FALSE"
" AND"
" account_pub=$1;",
@@ -1119,7 +1116,7 @@ libsync_plugin_db_postgres_init (void *cls)
"WHERE"
" expiration_date < $1;",
1),
- GNUNET_PQ_make_prepare ("gc_accounts",
+ GNUNET_PQ_make_prepare ("gc_pending_payments",
"DELETE FROM payments "
"WHERE"
" paid=FALSE"