diff options
| -rw-r--r-- | sql/dawn.sql | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 8f9a4118..f9cf3af7 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -34,6 +34,8 @@ CREATE TYPE protection AS ENUM('Buyer', 'Seller'); CREATE TYPE call_notice AS ENUM('24H', '48H', '3D', '4D', '5D', '6D', '1W', '8D', '9D', '10D', '2W', '1M', '2M'); +CREATE TYPE source AS ENUM('Broker','IDC','S&P','BVAL','PRICESERVE','PRICINGDIRECT','MARKIT','PB','Reuters','Manager') + CREATE TABLE counterparties(code varchar(12) primary key, name text, city text, @@ -263,6 +265,13 @@ CREATE TABLE fx(date date PRIMARY KEY, eurusd float, cadusd float); +CREATE TABLE external_marks( + identifier varchar(12) REFERENCES securities ON UPDATE CASCADE, + date date, + mark float, + source source, + PRIMARY KEY (identifier, date)); + CREATE OR REPLACE function list_marks(p_date date, include_unsettled boolean DEFAULT False) RETURNS TABLE(identifier varchar(12), price float) AS $$ BEGIN |
