From 7dd5afe599bb973fe8c047cdcc6e3dd54e6248b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Fischer?= Date: Mon, 9 Dec 2019 15:57:50 +0100 Subject: [PATCH] Add made tests, db init to readme --- README.md | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/README.md b/README.md index 7d6951d..0c796f8 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,120 @@ It is possible to chain requests: [see doc](https://support.insomnia.rest/articl `npm install -g snowboard` +## Tests made +- add token to db/colnod +- edit token in db/colnod +- delete token from db/colnod +- add subject to colnod +- edit subject in colnod +- delete subject from colnod +- edit same token on both db/colnod (diffrent time) + +## First sync expected results +- 2892 tokens updated +- 173 tokens deleted +- 2894 subjects updated +- 117 subjects deleted + +## Database inicialization +- Token table +```SQL create +-- Table: public.colnod_token + +-- DROP TABLE public.colnod_token; + +CREATE TABLE public.colnod_token +( + id character(36) COLLATE pg_catalog."default" NOT NULL, + auth_errors integer DEFAULT 255, + description character varying(255) COLLATE pg_catalog."default", + enabled boolean DEFAULT true, + last_update timestamp without time zone DEFAULT '1970-01-01 00:00:00.001'::timestamp without time zone, + name character varying(255) COLLATE pg_catalog."default", + no_validity boolean DEFAULT true, + time_to_live integer DEFAULT 255, + token_bits integer DEFAULT 32, + token_data character varying(255) COLLATE pg_catalog."default", + token_type character varying(255) COLLATE pg_catalog."default" DEFAULT 'Token'::character varying, + subject_id character(36) COLLATE pg_catalog."default", + last_modified timestamp without time zone NOT NULL, + deleted boolean DEFAULT false, + CONSTRAINT colnod_token_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.colnod_token + OWNER to postgres; +``` +- Subject table +```SQL create +-- Table: public.colnod_subject + +-- DROP TABLE public.colnod_subject; + +CREATE TABLE public.colnod_subject +( + id character(36) COLLATE pg_catalog."default" NOT NULL, + description character varying(255) COLLATE pg_catalog."default", + last_update timestamp without time zone NOT NULL, + name character varying(255) COLLATE pg_catalog."default", + pin character varying(255) COLLATE pg_catalog."default", + last_modified timestamp without time zone, + deleted boolean, + CONSTRAINT colnod_subject_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.colnod_subject + OWNER to postgres; +``` +- Subject attributes table +```SQL create +-- Table: public.colnod_subject_attribute + +-- DROP TABLE public.colnod_subject_attribute; + +CREATE TABLE public.colnod_subject_attribute +( + id character varying(255) COLLATE pg_catalog."default" NOT NULL, + attribute_key character varying(255) COLLATE pg_catalog."default", + attribute_value character varying(255) COLLATE pg_catalog."default", + subject_id character(36) COLLATE pg_catalog."default", + CONSTRAINT colnod_subject_attribute_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.colnod_subject_attribute + OWNER to postgres; +``` +- Config +```SQL create +-- Table: public.config + +-- DROP TABLE public.config; + +CREATE TABLE public.config +( + last_sync bigint NOT NULL DEFAULT 0, + CONSTRAINT config_pkey PRIMARY KEY (last_sync) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.config + OWNER to postgres; +``` ## Possible checks [here](https://gitlab.com/spaceti-app/integrations/acs/colnod-connector/blob/master/doc/possible-checks.md)