create schema and sql table

This commit is contained in:
Paul Trowbridge 2022-04-03 00:50:49 -04:00
parent 53523eb330
commit a859ffa91a

View File

@ -1,4 +1,4 @@
--assumes schema fc already exists
CREATE SCHEMA IF NOT EXISTS fc;
--DROP TABLE IF EXISTS fc.target_meta;
CREATE TABLE IF NOT EXISTS fc.target_meta (
@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS fc.target_meta (
);
--ALTER TABLE fc.target_meta DROP CONSTRAINT IF EXISTS target_meta_pk;
ALTER TABLE fc.target_meta ADD CONSTRAINT IF NOT EXISTS target_meta_pk PRIMARY KEY (tname, cname);
ALTER TABLE fc.target_meta ADD CONSTRAINT target_meta_pk PRIMARY KEY (tname, cname);
COMMENT ON TABLE fc.target_meta IS 'target table layout info';
COMMENT ON COLUMN fc.target_meta.tname IS 'schema.table_name of target sales data table';
@ -35,3 +35,5 @@ CREATE TABLE IF NOT EXISTS fc.log (
);
COMMENT ON TABLE fc.log IS 'forecast change log';
CREATE TABLE IF NOT EXISTS fc.sql(cmd text PRIMARY KEY, t text );