aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sql/dawn.sql12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index a91ef349..9a4a02eb 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -456,7 +456,7 @@ CREATE TABLE repos (
day_count day_count NULL,
ticket varchar NULL,
open_repo bool NULL,
- account_code text NOT NULL DEFAULT 'BAC' REFERENCES accounts(code),
+ cash_account text REFERENCES accounts2(cash_account),
CHECK ((haircut IS NOT NULL AND weighted_amount IS NULL) OR
(haircut IS NULL AND weighted_amount IS NOT NULL)),
CHECK (cusip IS NOT NULL OR isin IS NOT NULL)
@@ -465,6 +465,16 @@ CREATE TABLE repos (
ALTER TABLE repo OWNER TO dawn_user;
+CREATE TRIGGER cash_account BEFORE
+INSERT OR UPDATE OF
+ fund,
+ cp_code
+ON
+ repos
+FOR EACH ROW
+EXECUTE PROCEDURE update_account('Cash');
+
+
CREATE TABLE swaptions(id serial PRIMARY KEY,
dealid varchar(28) NOT NULL UNIQUE,
fund fund NOT NULL DEFAULT 'SERCGMAST',