aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-03-06 17:52:24 +0100
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-03-06 17:52:24 +0100
commit8c16c7372a2c9617e1ff8f235718f9e82cb6414a (patch)
tree3fcd2ffe4cb767cb6916d56fa89010740cae4368
parenta458eab0ccccc1d2dd3ecd724e629728ba686b7d (diff)
db: Add `reserves_out' table.
-rw-r--r--src/mint/mint_db.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mint/mint_db.c b/src/mint/mint_db.c
index b102accff..36e88a794 100644
--- a/src/mint/mint_db.c
+++ b/src/mint/mint_db.c
@@ -174,7 +174,20 @@ TALER_MINT_DB_create_tables (int temporary)
",expiration_date INT8 NOT NULL"
");");
/* Create an index on the foreign key as it is not created automatically by PSQL */
- SQLEXEC ("CREATE INDEX reserves_in_index ON reserves_in (reserve_pub);");
+ SQLEXEC ("CREATE INDEX reserves_in_reserve_pub_index"
+ " ON reserves_in (reserve_pub);");
+ SQLEXEC ("CREATE TABLE IF NOT EXISTS reserves_out"
+ "("
+ " reserve_pub BYTEA REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
+ ",value INT4 NOT NULL"
+ ",fraction INT4 NOT NULL"
+ ",blind_ev BYTEA PRIMARY KEY"
+ ",denom_pub BYTEA NOT NULL" /* FIXME: Make this a foreign key? */
+ ",auth_sig BYTEA NOT NULL"
+ ")");
+ SQLEXEC ("CREATE INDEX reserves_out_reserve_pub_index"
+ " ON reserves_out (reserve_pub);");
+
SQLEXEC ("CREATE TABLE IF NOT EXISTS collectable_blindcoins"
"("
"blind_ev BYTEA PRIMARY KEY"