diff options
| -rw-r--r-- | sql/serenitasdb.sql | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/serenitasdb.sql b/sql/serenitasdb.sql index 8282ca5c..efbf68df 100644 --- a/sql/serenitasdb.sql +++ b/sql/serenitasdb.sql @@ -431,16 +431,16 @@ CREATE TABLE index_quotes_old( CREATE TABLE index_quotes_pre (
id serial NOT NULL PRIMARY KEY,
- date date,
- index index_type,
- series smallint,
- version smallint,
- tenor tenor,
+ date date NOT NULL,
+ index index_type NOT NULL,
+ series smallint NOT NULL,
+ version smallint NOT NULL,
+ tenor tenor NOT NULL,
close_price float,
close_spread float,
model_price float,
model_spread float,
- source bbgsource,
+ source bbgsource NOT NULL,
UNIQUE (date, index, series, tenor, version, source)
);
@@ -457,8 +457,9 @@ CREATE TABLE index_risk2( );
CREATE OR REPLACE VIEW index_quotes AS
-SELECT date, index, series, version, tenor, close_price, close_spread,
-model_price, model_spread, duration, theta, duration2, theta2
+SELECT id, date, index, series, version, tenor, close_price AS closeprice,
+close_spread AS closespread,
+model_price AS modelprice, model_spread AS modelspread, duration, theta, duration2, theta2
FROM index_quotes_pre
LEFT JOIN index_risk USING (id)
LEFT JOIN index_risk2 USING(id)
|
