ALTER TABLE esemeny ADD COLUMN m_userid character varying(20);
ALTER TABLE esemeny ALTER COLUMN m_userid SET STORAGE EXTENDED;
ALTER TABLE esemeny ALTER COLUMN m_userid SET DEFAULT '';

ALTER TABLE esemeny ADD COLUMN m_date date;
ALTER TABLE esemeny ALTER COLUMN m_date SET STORAGE PLAIN;
ALTER TABLE esemeny ALTER COLUMN m_date SET DEFAULT '2005-01-01';

ALTER TABLE esemeny ADD COLUMN m_time time without time zone;
ALTER TABLE esemeny ALTER COLUMN m_time SET STORAGE PLAIN;
ALTER TABLE esemeny ALTER COLUMN m_time SET DEFAULT '00:00:00';

ALTER TABLE esemeny ADD COLUMN c_userid character varying(20);
ALTER TABLE esemeny ALTER COLUMN c_userid SET STORAGE EXTENDED;
ALTER TABLE esemeny ALTER COLUMN c_userid SET DEFAULT '';

ALTER TABLE esemeny ADD COLUMN c_date date;
ALTER TABLE esemeny ALTER COLUMN c_date SET STORAGE PLAIN;
ALTER TABLE esemeny ALTER COLUMN c_date SET DEFAULT '2005-01-01';

ALTER TABLE esemeny ADD COLUMN c_time time without time zone;
ALTER TABLE esemeny ALTER COLUMN c_time SET STORAGE PLAIN;
ALTER TABLE esemeny ALTER COLUMN c_time SET DEFAULT '00:00:00';



CREATE TABLE esemeny_naplo
(
  kod serial NOT NULL,
  naploszam integer,
  esemeny_kod integer,
  megjegyzes character varying(100),
  leiras text,
  datum date,
  partner_kod integer NOT NULL DEFAULT 0,
  m_userid character varying(20) DEFAULT '',
  m_date date DEFAULT '2005-01-01',
  m_time time without time zone DEFAULT '00:00:00',
  c_userid character varying(20) DEFAULT '',
  c_date date DEFAULT '2005-01-01',
  c_time time without time zone DEFAULT '00:00:00',
  CONSTRAINT esemeny_naplo_pkey PRIMARY KEY (kod, partner_kod)
) 
WITHOUT OIDS;


