diff options
| -rw-r--r-- | sql/dawn.sql | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index eb6b60cd..c9d374c6 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -309,6 +309,7 @@ CREATE TABLE cds(id serial primary key, stale bool default true, traded_level numeric(9, 5) NULL, exercised_from text REFERENCES swaptions(dealid), + delta_id integer REFERENCES cds(id), CONSTRAINT tranche_check CHECK (( swap_type IN ('CD_INDEX_TRANCHE', 'BESPOKE') AND (orig_attach IS NOT NULL AND orig_detach IS NOT NULL AND clearing_facility IS NULL)) @@ -495,6 +496,7 @@ CREATE TABLE swaptions(id serial PRIMARY KEY, cpty_id text, globeop_id int, full_globeop_id text GENERATED ALWAYS AS ('SWO'||lpad(cast(globeop_id as text), 6, '0')|| 'K00SCLMA') STORED, + delta_id int REFERENCES cds(id), ); CREATE TRIGGER swaptions_dealid BEFORE INSERT ON swaptions |
