aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 9b52c121..b2707cc3 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -368,6 +368,9 @@ CREATE TABLE repos (
ticket varchar NULL,
open_repo bool NULL,
account_code text NOT NULL DEFAULT 'BAC' REFERENCES accounts(code),
+ 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)
);