aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql54
1 files changed, 54 insertions, 0 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 11890840..0da551b7 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -505,6 +505,60 @@ CREATE TABLE mark_source_mapping(
final text,
PRIMARY KEY (globeop));
+CREATE TABLE subscription_and_fee(
+ date date,
+ fund fund,
+ subscription float,
+ redemption float,
+ incentive_fee float,
+ management_fee float,
+ PRIMARY KEY (fund, date));
+
+CREATE TABLE bbh_val(
+ accounting_date date NOT NULL,
+ row integer NOT NULL,
+ custody_head_account_number float,
+ security_id text,
+ security_description text,
+ asset_currency text,
+ original_face float,
+ base_price float,
+ local_unit_cost float,
+ base_unit_cost float,
+ local_market_value float,
+ base_market_value float,
+ security_id_type text,
+ sub_security_type_code text,
+ source text,
+ investment_type_code text,
+ investment_type_description text,
+ security_long_description text,
+ security_type_code text,
+ total_current_assets float,
+ total_current_liabilities float,
+ total_net_assets float,
+ PRIMARY KEY (accounting_date, row));
+
+CREATE TABLE bbh_pnl(
+ accounting_date date NOT NULL,
+ row integer NOT NULL,
+ security_id text,
+ custody_head_account_number float,
+ issue_name text,
+ local_currency text,
+ base_market_value float,
+ base_change_income float,
+ base_change_fx_realized_gain_loss float,
+ base_change_fx_unrealized_gain_loss float,
+ base_change_unrealized_gain_loss float,
+ base_change_realized_gain_loss float,
+ base_change_miscellaneous_income float,
+ base_change_expense float,
+ base_change_total float,
+ sub_security_type_code text,
+ source text,
+ PRIMARY KEY (accounting_date, row));
+
CREATE OR REPLACE function list_marks(p_date date)
RETURNS TABLE(p_date date, identifier varchar(12), price float) AS $$
BEGIN