aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 488c9468..878947bf 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -54,7 +54,7 @@ CREATE TABLE bonds(id serial primary key,
folder bond_strat NOT NULL,
custodian varchar(12) NOT NULL,
cashaccount varchar(10) NOT NULL,
- cp_code varchar(12) NOT NULL REFERENCES counterparties(code),
+ cp_code varchar(12) NOT NULL REFERENCES counterparties(code) ON UPDATE CASCADE,
trade_date date NOT NULL,
settle_date date NOT NULL,
cusip varchar(9),
@@ -92,7 +92,7 @@ CREATE TABLE cds(id serial primary key,
folder cds_strat NOT NULL,
custodian varchar(12) NOT NULL,
cashaccount varchar(10) NOT NULL,
- cp_code varchar(12) NOT NULL REFERENCES counterparties(code),
+ cp_code varchar(12) NOT NULL REFERENCES counterparties(code) ON UPDATE CASCADE,
trade_date date NOT NULL,
effective_date date NOT NULL,
maturity date NOT NULL,
@@ -193,12 +193,12 @@ CREATE TABLE securities(identifier varchar(12) PRIMARY KEY,
ALTER TABLE securities OWNER TO dawn_user;
CREATE TABLE marks(date date,
- identifier varchar(12) REFERENCES securities(identifier) ON DELETE CASCADE,
+ identifier varchar(12) REFERENCES securities(identifier) ON DELETE CASCADE ON UPDATE CASCADE,
price float,
PRIMARY KEY(identifier, date));
CREATE TABLE cashflow_history(
- identifier varchar(12) REFERENCES securities,
+ identifier varchar(12) REFERENCES securities ON UPDATE CASCADE,
date date,
principal_bal float,
principal float,