CREATE TABLE _cimke
(
  kod serial NOT NULL,
  fej_kod integer DEFAULT 0,
  visible integer DEFAULT 0,
  objecttype character(20),
  fieldname character(100),
  fontname character(100),
  fontsize integer DEFAULT 0,
  fontbold integer DEFAULT 0,
  fontitalic integer DEFAULT 0,
  fontunderline integer DEFAULT 0,
  fontstrikeout integer DEFAULT 0,
  leftposition integer DEFAULT 0,
  topposition integer DEFAULT 0,
  width integer DEFAULT 0,
  height integer DEFAULT 0,
  barcodetype character(100),
  statictext character(250),
  alignment character(20),
  autosize integer DEFAULT 0,
  picture bytea,
  CONSTRAINT _cimke_pkey PRIMARY KEY (kod)
) 
WITHOUT OIDS;

CREATE TABLE _cimke_fej
(
  kod serial NOT NULL,
  pageheight integer DEFAULT 0,
  pagewidth integer DEFAULT 0,
  labelheight integer DEFAULT 0,
  labelwidth integer DEFAULT 0,
  topmargin integer DEFAULT 0,
  bottommargin integer DEFAULT 0,
  leftmargin integer DEFAULT 0,
  rightmargin integer DEFAULT 0,
  labelverticalspace integer DEFAULT 0,
  labelhorizontalspace integer DEFAULT 0,
  columns integer DEFAULT 0,
  name character(200),
  CONSTRAINT _cimke_fej_pkey PRIMARY KEY (kod)
) 
WITHOUT OIDS;

CREATE TABLE bizonylatszoveg
(
  kod serial NOT NULL,
  sor_kod integer,
  nev character varying(100),
  sor2 character varying(100),
  sor3 character varying(100),
  sor4 character varying(100),
  tetel_azonosito_kod character varying(20),
  mee character varying(20),
  afa_leiras character varying(50),
  CONSTRAINT bizonylatszoveg_pkey PRIMARY KEY (kod)
) 
WITHOUT OIDS;

CREATE TABLE bizonylatszoveg_fej
(
  kod serial NOT NULL,
  partner_nev character varying(120),
  partner_orszag character varying(50),
  partner_iszam character varying(20),
  partner_telepules character varying(60),
  partner_cim character varying(60),
  partner_adoszam character varying(20),
  mozgasnem_nev character varying(100),
  fizetesmod_nev character varying(50),
  munkatars_nev character varying(60),
  fej_kod integer,
  partner_eng_szam character varying(30),
  partner_ostermeloi_szam character varying(30),
  fizetesmod_zaradek character varying(100),
  CONSTRAINT bizonylatszoveg_fej_pkey PRIMARY KEY (kod)
) 
WITHOUT OIDS;

ALTER TABLE partner ADD COLUMN gyujto integer;
ALTER TABLE partner ALTER COLUMN gyujto SET STORAGE PLAIN;
ALTER TABLE partner ALTER COLUMN gyujto SET DEFAULT 0;
update partner set gyujto = 0 where gyujto is null;

ALTER TABLE raktar_mozgas ADD COLUMN mee_kod integer;
ALTER TABLE raktar_mozgas ALTER COLUMN mee_kod SET STORAGE PLAIN;

ALTER TABLE kesziteslista ADD COLUMN mee_kod integer;
ALTER TABLE kesziteslista ALTER COLUMN mee_kod SET STORAGE PLAIN;

ALTER TABLE tulajdonos ADD COLUMN modul character(40);
ALTER TABLE tulajdonos ALTER COLUMN modul SET STORAGE EXTENDED;
update tulajdonos set modul = '1111111111111111111111111111111111111111';