diff options
Diffstat (limited to 'sql/dawn.sql')
| -rw-r--r-- | sql/dawn.sql | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 8cb6e519..73328645 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -2188,7 +2188,7 @@ CREATE TABLE pnl_reports( CREATE INDEX on pnl_reports (date); -CREATE TYPE clearing_cp AS ENUM('ICE-CREDIT', 'NOT CLEARED'); +CREATE TYPE clearing_cp AS ENUM('ICE-CREDIT', 'NOT CLEARED', 'LCH-LTD'); CREATE TYPE trade_type AS ENUM('CREDIT_DEFAULT_SWAP', 'SWAPTION', 'TRANCHE'); CREATE TYPE transaction_status AS ENUM('Bilateral', 'Cleared'); CREATE TYPE calendar AS ENUM('Payment-GB,US', 'Payment-US,GB', 'Payment-EU,GB', 'Payment-US'); @@ -3060,62 +3060,63 @@ CREATE TABLE public.fx_tickets ( CREATE TABLE public.irs ( - id serial4 NOT NULL, + id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, dealid text NULL GENERATED ALWAYS AS ('IRS_'::text || id::text) STORED, - lastupdate timestamp NULL DEFAULT now(), - "action" public."action" NOT NULL, - folder text NOT NULL, - custodian text NULL, - cashaccount text NULL, + "fund" public."fund" NOT NULL DEFAULT 'SERCGMAST'::fund, + "portfolio" public."portfolio" NOT NULL, + folder public."cds_strat" NOT NULL, + cash_account text NOT NULL REFERENCES accounts2(cash_account) ON UPDATE CASCADE, cp_code varchar(12) NOT NULL, trade_date date NOT NULL, - settle_date date NOT NULL, effective_date date NOT NULL, maturity_date date NOT NULL, - buysell bool NOT NULL, - bbg_ticker varchar(32) NOT NULL, payreceive bool NOT NULL, - fixed_amount float8 NOT NULL, fixed_rate float8 NOT NULL, - fixed_daycount text NOT NULL, + fixed_daycount public."day_count" NOT NULL, fixed_payment_freq text NOT NULL, - fixed_currency text NOT NULL, - float_amount float8 NOT NULL, + notional float8 NOT NULL, float_daycount text NOT NULL, float_payment_freq text NOT NULL, float_index text NOT NULL, - float_currency text NOT NULL, + "currency" text NOT NULL, initial_margin_percentage float8 NULL, float_fixing_freq text NOT NULL, pay_interest_calc_method text NOT NULL, - clearing_facility varchar(12) NULL DEFAULT NULL::character varying, + clearing_facility clearing_cp NOT NULL DEFAULT 'LCH-LTD'::clearing_cp, swaptype text NOT NULL, - "fund" public."fund" NOT NULL DEFAULT 'SERCGMAST'::fund + cleared_trade_id text NULL, ); -CREATE TYPE public."bbg_code_type" AS ENUM ( +CREATE TYPE "bbg_code_type" AS ENUM ( 'BOND', 'CDS', 'FX'); +CREATE TYPE "interest_calc_method" AS ENUM ( + 'Compound', + 'Simple'); + CREATE TABLE public.trs ( - id serial4 NOT NULL PRIMARY KEY, + id int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, dealid text NULL GENERATED ALWAYS AS ('TRS'::text || id::text) STORED, - "portfolio" public."portfolio" NOT NULL, - folder public."cds_strat" NOT NULL, + "fund" "fund" NOT NULL DEFAULT 'SERCGMAST'::fund, + "portfolio" "portfolio" NOT NULL, + folder "cds_strat" NOT NULL, cash_account text NOT NULL REFERENCES accounts2(cash_account) ON UPDATE CASCADE, cp_code varchar(12) NOT NULL REFERENCES counterparties(code) ON UPDATE CASCADE, trade_date date NOT NULL, effective_date date NOT NULL, maturity_date date NOT NULL, buysell bool NOT NULL, - underlying varchar(32) NOT NULL, + underlying_security varchar(32) NOT NULL, price float8 NOT NULL, - upfront float8 NOT NULL, + accrued float8 NOT NULL, initial_margin_percentage float8 NOT NULL, notional float8 NOT NULL, - "fund" public."fund" NOT NULL DEFAULT 'SERCGMAST'::fund, - "currency" public."currency" NOT NULL DEFAULT 'USD'::currency, - cpty_id text NULL, + "currency" "currency" NOT NULL DEFAULT 'USD'::currency, + interest_calc_method interest_calc_method NOT NULL, + compound_avg_frequency frequency NOT NULL, + fixing_frequency frequency NOT NULL, + cpty_id text NULL );
\ No newline at end of file |
