Last active
December 1, 2015 06:20
-
-
Save yogonza524/93ae681ea01ec7e26b94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Table: public.config | |
-- DROP TABLE public.config; | |
CREATE TABLE public.config | |
( | |
id character varying(255) NOT NULL, | |
dia_emision integer NOT NULL, | |
dia_vencimiento integer NOT NULL, | |
fecha_creacion timestamp with time zone, | |
fecha_ultima_modificacion timestamp with time zone, | |
CONSTRAINT config_pk PRIMARY KEY (id) | |
) | |
WITH ( | |
OIDS=FALSE | |
); | |
ALTER TABLE public.config | |
OWNER TO postgres; | |
COMMENT ON TABLE public.config | |
IS 'Esta tabla solo puede contener un registro y solo uno'; | |
-- Trigger: check_record on public.config | |
-- DROP TRIGGER check_record ON public.config; | |
CREATE TRIGGER check_record | |
BEFORE INSERT | |
ON public.config | |
FOR EACH ROW | |
EXECUTE PROCEDURE public.check_record(); | |
-- Trigger: update_config on public.config | |
-- DROP TRIGGER update_config ON public.config; | |
CREATE TRIGGER update_config | |
BEFORE UPDATE | |
ON public.config | |
FOR EACH ROW | |
EXECUTE PROCEDURE public.update_config(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Esta tabla se encarga de mantener los dias de emision y vencimiento de factura. Solo puede tener un registro y solo uno. El ingreso de nuevos registros o la modificación es controlada por triggers.