Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrisj add capability history #21

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/telescope-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.6
version: 0.3.7
57 changes: 57 additions & 0 deletions charts/telescope-backend/files/db_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,63 @@ ALTER TABLE ONLY public.integrations

GRANT ALL ON TABLE public.integration_methods TO telescope;

--
-- Name: capability_history(); Type: FUNCTION; Schema: public; Owner: postgres
--

CREATE FUNCTION public.capability_history() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO
capability_history(capability_id,flag)
VALUES(new.id,new.flag_id);
RETURN new;
END;
$$;


ALTER FUNCTION public.capability_history() OWNER TO postgres;


CREATE TABLE public.capability_history (
id integer NOT NULL,
capability_id integer,
flag integer,
updated timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE public.capability_history OWNER TO telescope;

--
-- Name: capability_history_id_seq; Type: SEQUENCE; Schema: public; Owner: telescope
--

CREATE SEQUENCE public.capability_history_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


ALTER TABLE public.capability_history_id_seq OWNER TO telescope;

--
-- Name: capability_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: telescope
--

ALTER SEQUENCE public.capability_history_id_seq OWNED BY public.capability_history.id;


--
-- Name: capability capability_trigger_copy; Type: TRIGGER; Schema: public; Owner: telescope
--

CREATE TRIGGER capability_trigger_copy AFTER UPDATE ON public.capability FOR EACH ROW EXECUTE FUNCTION public.capability_history();


--
-- PostgreSQL database dump complete
Expand Down
Loading