big bundle of changes.

* reorganize templates even more (and a small layout break)
* rename wallets.hash and accounts.userhash to id
* refactor /wallets so it's idempotent for each param combination
* many small changes
This commit is contained in:
fiatjaf
2019-12-14 15:49:41 -03:00
parent 1cee6dad42
commit 14dfa9ecc6
8 changed files with 796 additions and 795 deletions
+3 -5
View File
@@ -1,11 +1,11 @@
CREATE TABLE IF NOT EXISTS accounts (
userhash text PRIMARY KEY,
id text PRIMARY KEY,
email text,
pass text
);
CREATE TABLE IF NOT EXISTS wallets (
hash text PRIMARY KEY,
id text PRIMARY KEY,
name text NOT NULL,
user text NOT NULL,
adminkey text NOT NULL,
@@ -21,9 +21,7 @@ CREATE TABLE IF NOT EXISTS apipayments (
memo text
);
DROP VIEW IF EXISTS balances;
CREATE VIEW balances AS
CREATE VIEW IF NOT EXISTS balances AS
SELECT wallet, coalesce(sum(s), 0) AS balance FROM (
SELECT wallet, sum(amount) AS s -- incoming
FROM apipayments