diff options
author | pacien | 2021-07-25 14:20:30 +0200 |
---|---|---|
committer | pacien | 2021-07-25 14:20:30 +0200 |
commit | 85febbe5a2eeab4463b5463b55dc232f141f2588 (patch) | |
tree | 3a8c1f9a3c4d41f3692f0e5a61c1182c1f3846ed /sql/tables.sql | |
parent | 5fa8d869f476323d5243111b6c6c785c83d99400 (diff) | |
download | uge_l2_rdbms_python_proto-85febbe5a2eeab4463b5463b55dc232f141f2588.tar.gz |
sql: add queries (with embrace)
Diffstat (limited to 'sql/tables.sql')
-rw-r--r-- | sql/tables.sql | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/tables.sql b/sql/tables.sql index d56156b..37ffbff 100644 --- a/sql/tables.sql +++ b/sql/tables.sql | |||
@@ -41,3 +41,9 @@ create table transactions ( | |||
41 | (operation in ('fee', 'withdrawal') or recipient is not null), | 41 | (operation in ('fee', 'withdrawal') or recipient is not null), |
42 | amount simoleon not null check (amount > 0) | 42 | amount simoleon not null check (amount > 0) |
43 | ); | 43 | ); |
44 | |||
45 | -- Additional indexes for the financial transaction log for the common | ||
46 | -- participant-centered queries. Those also include the datetime column, which | ||
47 | -- is useful for paginating the log. | ||
48 | create index transaction_source_index on transactions (source, datetime); | ||
49 | create index transaction_recipient_index on transactions (recipient, datetime); | ||