Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TOAR-II FastAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
toar-data
TOAR-II FastAPI
Commits
dd565d18
Commit
dd565d18
authored
4 years ago
by
Sabine Schröder
Browse files
Options
Downloads
Patches
Plain Diff
#17
: Update db_changes.psql: create table data_archive (as a schema copy from table data)
parent
da87a5bc
No related branches found
No related tags found
No related merge requests found
Pipeline
#48112
passed
4 years ago
Stage: deploy
Stage: pages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
db_changes.psql
+32
-1
32 additions, 1 deletion
db_changes.psql
with
32 additions
and
1 deletion
db_changes.psql
+
32
−
1
View file @
dd565d18
...
...
@@ -53,3 +53,34 @@ ALTER TABLE stationmeta_core
ALTER TABLE stationmeta_annotations
ALTER COLUMN kind SET DEFAULT 0,
ADD CONSTRAINT stationmeta_annotations_kind_fk_ak_vocabulary_enum_val FOREIGN KEY(kind) REFERENCES ak_vocabulary(enum_val);
-- https://gitlab.version.fz-juelich.de/toar/toardb_fastapi/-/issues/17
CREATE TABLE public.data_archive (
datetime timestamp with time zone NOT NULL,
value double precision NOT NULL,
flags integer NOT NULL,
timeseries_id integer NOT NULL,
version character(28) DEFAULT '000001.000000.00000000000000'::bpchar NOT NULL,
CONSTRAINT data_archive_flags_check CHECK ((flags >= 0))
);
ALTER TABLE ONLY public.data_archive
ADD CONSTRAINT data_archive_pkey PRIMARY KEY (timeseries_id, datetime);
ALTER TABLE ONLY public.data_archive
ADD CONSTRAINT data_archive_timeseries_id_datetime_uniq UNIQUE (timeseries_id, datetime);
CREATE INDEX data_archive_datetime ON public.data_archive USING btree (datetime);
CREATE INDEX data_archive_timeseries_id ON public.data_archive USING btree (timeseries_id);
CREATE INDEX data_archive_value_idx ON public.data_archive USING btree (value);
ALTER TABLE ONLY public.data_archive
ADD CONSTRAINT data_archive_flags_fk_df_vocabulary_enum_val FOREIGN KEY (flags) REFERENCES public.df_vocabulary(enum_val);
ALTER TABLE ONLY public.data_archive
ADD CONSTRAINT data_archive_timeseries_id_fk_timeseries_id FOREIGN KEY (timeseries_id) REFERENCES public.timeseries(id) DEFERRABLE INITIALLY DEFERRED;
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE public.data_archive TO toarv2_rw;
GRANT SELECT,INSERT,UPDATE ON TABLE public.data_archive TO toaruser;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment