aboutsummaryrefslogtreecommitdiff
path: root/res/sql/views
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-02-07 23:57:36 +0100
committerPacien TRAN-GIRARD2015-02-07 23:57:36 +0100
commit3d22cb7d1ee6bdf7b484bbf001c76e81ae351dea (patch)
tree69470d595030a0f0abce97e779db99ff8e21425a /res/sql/views
parentde24f5b788c1ae6307eb360877ea3ce61c8f7a6a (diff)
downloadminibay-3d22cb7d1ee6bdf7b484bbf001c76e81ae351dea.tar.gz
Update accounts view to include usernames
Diffstat (limited to 'res/sql/views')
-rw-r--r--res/sql/views/orcl_accounts.sql1
-rw-r--r--res/sql/views/pg_accounts.sql1
2 files changed, 2 insertions, 0 deletions
diff --git a/res/sql/views/orcl_accounts.sql b/res/sql/views/orcl_accounts.sql
index 400d38f..f3f5d6e 100644
--- a/res/sql/views/orcl_accounts.sql
+++ b/res/sql/views/orcl_accounts.sql
@@ -2,6 +2,7 @@ CREATE OR REPLACE VIEW accounts AS
2 2
3 SELECT 3 SELECT
4 users.uuid AS user_uuid, 4 users.uuid AS user_uuid,
5 users.username AS username,
5 COALESCE(transactions.balance, 0) AS balance, 6 COALESCE(transactions.balance, 0) AS balance,
6 COALESCE(sales.open_bids, 0) AS open_bids, 7 COALESCE(sales.open_bids, 0) AS open_bids,
7 COALESCE(transactions.balance, 0) - COALESCE(sales.open_bids, 0) AS equity 8 COALESCE(transactions.balance, 0) - COALESCE(sales.open_bids, 0) AS equity
diff --git a/res/sql/views/pg_accounts.sql b/res/sql/views/pg_accounts.sql
index 400d38f..f3f5d6e 100644
--- a/res/sql/views/pg_accounts.sql
+++ b/res/sql/views/pg_accounts.sql
@@ -2,6 +2,7 @@ CREATE OR REPLACE VIEW accounts AS
2 2
3 SELECT 3 SELECT
4 users.uuid AS user_uuid, 4 users.uuid AS user_uuid,
5 users.username AS username,
5 COALESCE(transactions.balance, 0) AS balance, 6 COALESCE(transactions.balance, 0) AS balance,
6 COALESCE(sales.open_bids, 0) AS open_bids, 7 COALESCE(sales.open_bids, 0) AS open_bids,
7 COALESCE(transactions.balance, 0) - COALESCE(sales.open_bids, 0) AS equity 8 COALESCE(transactions.balance, 0) - COALESCE(sales.open_bids, 0) AS equity