CREATE TRIGGER zalohuj_rezervaci before delete ON rezervace
FOR each row 

 INSERT INTO archiv_rezervace (id_rezervace,id_uzivatele, od, do, poznamka)
 values (old.id_rezervace,old.id_uzivatele, old.od, old.do, old.poznamka);   

CREATE TRIGGER zalohuj_detail before delete ON detail_rezervace
FOR each row 

 INSERT INTO archiv_detail_rezervace (id_rezervace,id_pokoje,id_sluzby,pocet_lidi)
 values (old.id_rezervace,old.id_pokoje, old.id_sluzby, old.pocet_lidi);

create trigger zalohuj_obdobi before delete on obdobi
for each row

insert into archiv_obdobi(id_obdobi, nazev_obdobi,datumplatod, datumplatdo,popis,id_druh_akce) values (old.id_obdobi, old.nazev_obdobi,old.datumplatod, old.datumplatdo,old.popis,old.id_druh_akce);


create trigger zalohuj_strava_v_obdobi before delete on strava_v_obdobi
for each row

insert into archiv_strava_v_obdobi(id_strava_v_obdobi, id_strava, id_obdobi) values (old.id_strava_v_obdobi, old.id_strava, old.id_obdobi);


create trigger zalohuj_cenik before delete on cenik_sluzeb
for each row

insert into archiv_cenik_sluzeb(id_sluzby, id_strava_v_obdobi,id_druh_hostu, cena) values (old.id_sluzby, old.id_strava_v_obdobi,old.id_druh_hostu, old.cena);




