#[ ZACATEK SOUBORU ]#

#DEF <SCHEMA>    food600
#DEF <PRIMARYKEY> idriadok
#DEF <TABLENAME> zurnal

#[ CREATE TABLE ZACATEK ]#
    modul integer NOT NULL DEFAULT 0,
    rok smallint NOT NULL DEFAULT 0,
    mesiac smallint NOT NULL DEFAULT 0,
    text character varying(200) COLLATE pg_catalog."default",
    idriadok SERIAL,
    machine character varying(50) COLLATE pg_catalog."default",
    autor character(3) COLLATE pg_catalog."default",
    cas timestamp without time zone NOT NULL DEFAULT now(),
    c_stredisk integer NOT NULL DEFAULT 0,
    vyznam character(5) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::bpchar,
    c1 character varying(100) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::character varying,
    c2 character varying(100) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::character varying,
    c3 character varying(100) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::character varying,
    c4 character varying(100) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::character varying,
    n1 numeric(12,4) NOT NULL DEFAULT 0,
    n2 numeric(12,4) NOT NULL DEFAULT 0,
    n3 numeric(12,4) NOT NULL DEFAULT 0,
    pozn character varying(200) COLLATE pg_catalog."default" NOT NULL DEFAULT ' '::character varying,
    CONSTRAINT <TABLENAME>_<PRIMARYKEY> PRIMARY KEY (<PRIMARYKEY>)
#[ CREATE TABLE KONEC ]#

#[ IF EXIST ZACATEK ]#
#[ PRIMARYKEY ]#

COMMENT ON COLUMN <SCHEMA>.zurnal.modul
    IS '1 - autoexec
2 - man
3 - kasy
4 - limity';

	DELETE FROM <SCHEMA>.<TABLENAME> WHERE  cas < NOW() - '777 days'::interval ;

 END IF;
#[ KONEC SOUBORU ]#