create table zdiecia (
id int default 0 not null auto_increment primary key,
dzial varchar (100) not null,
zdiecie varchar(100) not null,
unique (dzial,zdiecie),
index (id)
) type=InnoDB;

create table komentaze (
id int default 0 not null auto_increment primary key,
id_zdiecia int not null,
tekst text,
podpis varchar (102),
stamp timestamp,
ip varchar(15),
index (id),
index (id_zdiecia),
foreign key (id_zdiecia) references zdiecia (id) on delete cascade on update restrict
) type=InnoDB;
