-- -- Name: normalize_on_insert(); Type: FUNCTION; Schema: public; Owner: pgdb -- CREATE OR REPLACE FUNCTION public.normalize_on_insert() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.reference = normalizeverse(NEW.reference); RETURN NEW; END; $$; ALTER FUNCTION public.normalize_on_insert() OWNER TO pgdb; -- -- Name: reference; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.reference ( translation character varying(12) NOT NULL, reference text NOT NULL ); ALTER TABLE public.reference OWNER TO pgdb; -- -- Name: reference reference_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.reference DROP CONSTRAINT IF EXISTS reference_pkey; ALTER TABLE ONLY public.reference ADD CONSTRAINT reference_pkey PRIMARY KEY (translation, reference); -- -- Name: reference reference_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS reference_normalize_on_insert_trigger ON public.reference; CREATE TRIGGER reference_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.reference FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_a_kingdom; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_a_kingdom ( ) INHERITS (public.reference); ALTER TABLE public.c_a_kingdom OWNER TO pgdb; -- -- Name: c_a_kingdom c_a_kingdom_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_a_kingdom DROP CONSTRAINT IF EXISTS c_a_kingdom_pkey; ALTER TABLE ONLY public.c_a_kingdom ADD CONSTRAINT c_a_kingdom_pkey PRIMARY KEY (translation, reference); -- -- Name: c_a_kingdom c_a_kingdom_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_a_kingdom_normalize_on_insert_trigger ON public.c_a_kingdom; CREATE TRIGGER c_a_kingdom_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_a_kingdom FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_because; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_because ( ) INHERITS (public.reference); ALTER TABLE public.c_because OWNER TO pgdb; -- -- Name: c_because c_because_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_because DROP CONSTRAINT IF EXISTS c_because_pkey; ALTER TABLE ONLY public.c_because ADD CONSTRAINT c_because_pkey PRIMARY KEY (translation, reference); -- -- Name: c_because c_because_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_because_normalize_on_insert_trigger ON public.c_because; CREATE TRIGGER c_because_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_because FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_bread; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_bread ( ) INHERITS (public.reference); ALTER TABLE public.c_bread OWNER TO pgdb; -- -- Name: c_bread c_bread_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_bread DROP CONSTRAINT IF EXISTS c_bread_pkey; ALTER TABLE ONLY public.c_bread ADD CONSTRAINT c_bread_pkey PRIMARY KEY (translation, reference); -- -- Name: c_bread c_bread_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_bread_normalize_on_insert_trigger ON public.c_bread; CREATE TRIGGER c_bread_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_bread FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_debtors; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_debtors ( ) INHERITS (public.reference); ALTER TABLE public.c_debtors OWNER TO pgdb; -- -- Name: c_debtors c_debtors_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_debtors DROP CONSTRAINT IF EXISTS c_debtors_pkey; ALTER TABLE ONLY public.c_debtors ADD CONSTRAINT c_debtors_pkey PRIMARY KEY (translation, reference); -- -- Name: c_debtors c_debtors_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_debtors_normalize_on_insert_trigger ON public.c_debtors; CREATE TRIGGER c_debtors_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_debtors FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_deliver; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_deliver ( ) INHERITS (public.reference); ALTER TABLE public.c_deliver OWNER TO pgdb; -- -- Name: c_deliver c_deliver_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_deliver DROP CONSTRAINT IF EXISTS c_deliver_pkey; ALTER TABLE ONLY public.c_deliver ADD CONSTRAINT c_deliver_pkey PRIMARY KEY (translation, reference); -- -- Name: c_deliver c_deliver_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_deliver_normalize_on_insert_trigger ON public.c_deliver; CREATE TRIGGER c_deliver_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_deliver FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_glory; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_glory ( ) INHERITS (public.reference); ALTER TABLE public.c_glory OWNER TO pgdb; -- -- Name: c_glory c_glory_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_glory DROP CONSTRAINT IF EXISTS c_glory_pkey; ALTER TABLE ONLY public.c_glory ADD CONSTRAINT c_glory_pkey PRIMARY KEY (translation, reference); -- -- Name: c_glory c_glory_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_glory_normalize_on_insert_trigger ON public.c_glory; CREATE TRIGGER c_glory_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_glory FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_name; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_name ( ) INHERITS (public.reference); ALTER TABLE public.c_name OWNER TO pgdb; -- -- Name: c_name c_name_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_name DROP CONSTRAINT IF EXISTS c_name_pkey; ALTER TABLE ONLY public.c_name ADD CONSTRAINT c_name_pkey PRIMARY KEY (translation, reference); -- -- Name: c_name c_name_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_name_normalize_on_insert_trigger ON public.c_name; CREATE TRIGGER c_name_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_name FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_tempt; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_tempt ( ) INHERITS (public.reference); ALTER TABLE public.c_tempt OWNER TO pgdb; -- -- Name: c_tempt c_tempt_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_tempt DROP CONSTRAINT IF EXISTS c_tempt_pkey; ALTER TABLE ONLY public.c_tempt ADD CONSTRAINT c_tempt_pkey PRIMARY KEY (translation, reference); -- -- Name: c_tempt c_tempt_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_tempt_normalize_on_insert_trigger ON public.c_tempt; CREATE TRIGGER c_tempt_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_tempt FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_will; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_will ( ) INHERITS (public.reference); ALTER TABLE public.c_will OWNER TO pgdb; -- -- Name: c_will c_will_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_will DROP CONSTRAINT IF EXISTS c_will_pkey; ALTER TABLE ONLY public.c_will ADD CONSTRAINT c_will_pkey PRIMARY KEY (translation, reference); -- -- Name: c_will c_will_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_will_normalize_on_insert_trigger ON public.c_will; CREATE TRIGGER c_will_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_will FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert(); -- -- Name: c_z_kingdom; Type: TABLE; Schema: public; Owner: pgdb -- CREATE TABLE IF NOT EXISTS public.c_z_kingdom ( ) INHERITS (public.reference); ALTER TABLE public.c_z_kingdom OWNER TO pgdb; -- -- Name: c_z_kingdom c_z_kingdom_pkey; Type: CONSTRAINT; Schema: public; Owner: pgdb -- ALTER TABLE ONLY public.c_z_kingdom DROP CONSTRAINT IF EXISTS c_z_kingdom_pkey; ALTER TABLE ONLY public.c_z_kingdom ADD CONSTRAINT c_z_kingdom_pkey PRIMARY KEY (translation, reference); -- -- Name: c_z_kingdom c_z_kingdom_normalize_on_insert_trigger; Type: TRIGGER; Schema: public; Owner: pgdb -- DROP TRIGGER IF EXISTS c_z_kingdom_normalize_on_insert_trigger ON public.c_z_kingdom; CREATE TRIGGER c_z_kingdom_normalize_on_insert_trigger BEFORE INSERT OR UPDATE ON public.c_z_kingdom FOR EACH ROW EXECUTE FUNCTION public.normalize_on_insert();