ALTER TABLE _reports
  ADD CONSTRAINT _reports_pkey PRIMARY KEY(kod);

CREATE INDEX _reports_i1
  ON _reports
  USING btree
  (userid);

ALTER TABLE _reports_items
  ADD CONSTRAINT _reports_items_pkey PRIMARY KEY(kod);

CREATE INDEX _reports_items_i1
  ON _reports_items
  USING btree
  (report_kod);