Skip to content

Commit

Permalink
Updated production_structure.sql file.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsrohde committed Apr 23, 2015
1 parent c1b8607 commit e556f5a
Showing 1 changed file with 259 additions and 8 deletions.
267 changes: 259 additions & 8 deletions db/production_structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,30 @@ CREATE TABLE citations_sites (
citation_id bigint,
site_id bigint,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone
updated_at timestamp(6) without time zone,
id bigint NOT NULL
);


--
-- Name: citations_sites_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE citations_sites_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: citations_sites_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE citations_sites_id_seq OWNED BY citations_sites.id;


--
-- Name: citations_treatments; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
Expand All @@ -319,10 +339,30 @@ CREATE TABLE citations_treatments (
citation_id bigint,
treatment_id bigint,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone
updated_at timestamp(6) without time zone,
id bigint NOT NULL
);


--
-- Name: citations_treatments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE citations_treatments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: citations_treatments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE citations_treatments_id_seq OWNED BY citations_treatments.id;


--
-- Name: counties_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -425,7 +465,7 @@ COMMENT ON COLUMN cultivars.name IS 'Cultivar name given by breeder or reported
-- Name: COLUMN cultivars.ecotype; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN cultivars.ecotype IS 'Does not apply for all species, used in the case of switchgrass to differentiate lowland and upland genotypes.';
COMMENT ON COLUMN cultivars.ecotype IS 'An ecotype is a distinct variety adapted to a particular environment. Implemented to distinguish ''upland'' and ''lowland'' Switchgrass cultivars. Can also be used to distinguish, e.g. species in temperate vs. tundra';


--
Expand Down Expand Up @@ -520,6 +560,13 @@ CREATE TABLE dbfiles (
);


--
-- Name: COLUMN dbfiles.container_type; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN dbfiles.container_type IS 'this and container_id are part of a polymorphic relationship, specifies table and primary key of that table';


--
-- Name: ensembles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -671,10 +718,30 @@ CREATE TABLE inputs_runs (
input_id bigint,
run_id bigint,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone
updated_at timestamp(6) without time zone,
id bigint NOT NULL
);


--
-- Name: inputs_runs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE inputs_runs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: inputs_runs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE inputs_runs_id_seq OWNED BY inputs_runs.id;


--
-- Name: inputs_variables; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
Expand All @@ -683,10 +750,30 @@ CREATE TABLE inputs_variables (
input_id bigint,
variable_id bigint,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone
updated_at timestamp(6) without time zone,
id bigint NOT NULL
);


--
-- Name: inputs_variables_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE inputs_variables_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: inputs_variables_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE inputs_variables_id_seq OWNED BY inputs_variables.id;


--
-- Name: likelihoods_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -841,10 +928,30 @@ CREATE TABLE managements_treatments (
treatment_id bigint,
management_id bigint,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone
updated_at timestamp(6) without time zone,
id bigint NOT NULL
);


--
-- Name: managements_treatments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE managements_treatments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: managements_treatments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE managements_treatments_id_seq OWNED BY managements_treatments.id;


--
-- Name: methods_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -1038,10 +1145,30 @@ CREATE TABLE pfts_priors (
pft_id bigint,
prior_id bigint,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone
updated_at timestamp(6) without time zone,
id bigint NOT NULL
);


--
-- Name: pfts_priors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE pfts_priors_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: pfts_priors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE pfts_priors_id_seq OWNED BY pfts_priors.id;


--
-- Name: pfts_species; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
Expand All @@ -1051,6 +1178,7 @@ CREATE TABLE pfts_species (
specie_id bigint NOT NULL,
created_at timestamp(6) without time zone,
updated_at timestamp(6) without time zone,
id bigint NOT NULL,
CONSTRAINT no_conflicting_member CHECK (no_cultivar_member(pft_id))
);

Expand All @@ -1069,6 +1197,25 @@ COMMENT ON TABLE pfts_species IS 'This table tells which species are members of
COMMENT ON CONSTRAINT no_conflicting_member ON pfts_species IS 'Ensure the pft_id does not refer to a pft having one or more cultivars as members; pfts referred to by this table con only contain other species.';


--
-- Name: pfts_species_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE pfts_species_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: pfts_species_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE pfts_species_id_seq OWNED BY pfts_species.id;


--
-- Name: posterior_samples; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
Expand Down Expand Up @@ -1136,10 +1283,30 @@ CREATE TABLE posteriors_ensembles (
posterior_id bigint,
ensemble_id bigint,
created_at timestamp without time zone,
updated_at timestamp without time zone
updated_at timestamp without time zone,
id bigint NOT NULL
);


--
-- Name: posteriors_ensembles_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE posteriors_ensembles_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: posteriors_ensembles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

ALTER SEQUENCE posteriors_ensembles_id_seq OWNED BY posteriors_ensembles.id;


--
-- Name: priors_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
Expand Down Expand Up @@ -1284,6 +1451,34 @@ CREATE TABLE runs (
);


--
-- Name: COLUMN runs.start_time; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN runs.start_time IS 'beginning of time period being simulated';


--
-- Name: COLUMN runs.finish_time; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN runs.finish_time IS 'end of time period being simulated';


--
-- Name: COLUMN runs.started_at; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN runs.started_at IS 'system time when run ends';


--
-- Name: COLUMN runs.finished_at; Type: COMMENT; Schema: public; Owner: -
--

COMMENT ON COLUMN runs.finished_at IS 'system time when run ends; can be null when record is created';


--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
Expand Down Expand Up @@ -2251,13 +2446,48 @@ CREATE TABLE workflows (
);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY citations_sites ALTER COLUMN id SET DEFAULT nextval('citations_sites_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY citations_treatments ALTER COLUMN id SET DEFAULT nextval('citations_treatments_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY current_posteriors ALTER COLUMN id SET DEFAULT nextval('current_posteriors_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY inputs_runs ALTER COLUMN id SET DEFAULT nextval('inputs_runs_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY inputs_variables ALTER COLUMN id SET DEFAULT nextval('inputs_variables_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY managements_treatments ALTER COLUMN id SET DEFAULT nextval('managements_treatments_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
Expand All @@ -2272,13 +2502,34 @@ ALTER TABLE ONLY modeltypes ALTER COLUMN id SET DEFAULT nextval('modeltypes_id_s
ALTER TABLE ONLY modeltypes_formats ALTER COLUMN id SET DEFAULT nextval('modeltypes_formats_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY pfts_priors ALTER COLUMN id SET DEFAULT nextval('pfts_priors_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY pfts_species ALTER COLUMN id SET DEFAULT nextval('pfts_species_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY posterior_samples ALTER COLUMN id SET DEFAULT nextval('posterior_samples_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY posteriors_ensembles ALTER COLUMN id SET DEFAULT nextval('posteriors_ensembles_id_seq'::regclass);


--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
Expand Down

0 comments on commit e556f5a

Please sign in to comment.