diff options
| -rw-r--r-- | sql/dawn.sql | 119 |
1 files changed, 11 insertions, 108 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 4cf637f9..113a0c74 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -1200,116 +1200,19 @@ CREATE FOREIGN TABLE priced_percentiles_orig_ntl( SERVER mysql_server OPTIONS (dbname 'rmbs_model'); -CREATE FOREIGN TABLE index_desc( - basketid integer, - index index_type, - series smallint, - version smallint, - indexfactor float, - cumulativeloss float, - lastdate date, - redindexcode text, - tenor tenor, - maturity date, - coupon integer, - issue_date date) - SERVER postgresql_server; - -CREATE FOREIGN TABLE index_version( - basketID serial, - Index index_type, - Series smallint, - Version smallint, - IndexFactor float, - CumulativeLoss float, - lastdate date, - redindexcode text) - SERVER postgresql_server; - -CREATE FOREIGN TABLE IF NOT EXISTS index_version_markit( - redindexcode text, - indexfamily text, - indexsubfamily text, - indexname text, - ccy currency, - indexfactor float, - recoveryrate float, - series smallint, - version smallint, - annexdate date, - effectivedate date, - firstpaymentdate date, - activeversion bool, - nextredindexcode text, - prevredindexcode text) -SERVER postgresql_server; - -CREATE FOREIGN TABLE index_maturity( - index index_type, - series smallint, - tenor tenor, - maturity date, - coupon integer, - issue_date date) - SERVER postgresql_server; - -CREATE IF NOT EXISTS FOREIGN TABLE index_quotes( - date date, - index index_type, - series smallint, - version smallint, - tenor tenor, - closeprice float, - closespread float, - modelprice float, - modelspread float, - duration float, - theta float, - duration2 float, - theta2 float) -SERVER postgresql_server; +CREATE TYPE INDEXFAMILY AS ENUM('ITRAXX-Asian', 'LCDXNA', 'MCDXNA', +'ITRAXX-SOVX', 'ITRAXX-SDI', 'ITRAXX-L', 'CDX', 'ITRAXX-European'); +CREATE TYPE curr AS ENUM('USD', 'EUR', 'JPY', 'GBP', 'CAD'); -CREATE FOREIGN TABLE markit_tranche_quotes( - quotedate date, - basketid integer, - tenor tenor, - attach smallint, - detach smallint, - upfront_bid float, - upfront_mid float, - upfront_ask float, - tranche_spread smallint, - index_price float) -SERVER postgresql_server; +IMPORT FOREIGN SCHEMA public FROM SERVER postgresql_server LIMIT TO +(index_desc, + index_version, + index_version_markit, + index_maturity, + index_quotes, + markit_tranche_quotes, + risk_num_per_quote) INTO public; -CREATE FOREIGN TABLE risk_num_per_quote( - tranche_id integer, - date date, - index text, - series integer, - tenor tenor, - index_price float, - index_basis float, - index_expected_loss float, - index_duration float, - index_theta float, - attach smallint, - detach smallint, - corr_at_detach float, - delta float, - forward_delta float, - gamma float, - theta float, - corr01 float, - duration float, - expected_loss float, - trancheupfrontmid float, - trancherunningmid float, - indexrefprice float, - indexrefspread smallint, - tranchedelta float, - quotesource text) - SERVER postgresql_server; CREATE FOREIGN TABLE model_versions( model_id smallint, |
