ALTER TABLE "contract_type_person"
    ADD CONSTRAINT "contract_type_person_id" PRIMARY KEY ("id");

-- spôsobuje chybu, existujú dva záznamy s ID=2

DELETE FROM "hw"
WHERE "comment" = 'MAC 032014J000465'
    AND "id" = '2';

ALTER TABLE "hw"
    ADD CONSTRAINT "hw_id" PRIMARY KEY ("id");

ALTER TABLE "hw_barcode"
    ADD CONSTRAINT "hw_barcode_id" PRIMARY KEY ("id");

ALTER TABLE "hw_brand"
    ADD CONSTRAINT "hw_brand_id" PRIMARY KEY ("id");

ALTER TABLE "hw_log"
    ADD CONSTRAINT "hw_log_id" PRIMARY KEY ("id");

ALTER TABLE "hw_status"
    ADD CONSTRAINT "hw_status_id" PRIMARY KEY ("id");

ALTER TABLE "hw_stock"
    ADD CONSTRAINT "hw_stock_id" PRIMARY KEY ("id");

ALTER TABLE "photo"
    ADD CONSTRAINT "photo_id" PRIMARY KEY ("id");

ALTER TABLE "photo_relation"
    ADD CONSTRAINT "photo_relation_id" PRIMARY KEY ("id");

ALTER TABLE "property"
    ADD CONSTRAINT "property_id" PRIMARY KEY ("id");

ALTER TABLE "property_part"
    ADD CONSTRAINT "property_part_id" PRIMARY KEY ("id");

ALTER TABLE "property_person"
    ADD CONSTRAINT "property_person_id" PRIMARY KEY ("id");

ALTER TABLE "property_person_role"
    ADD CONSTRAINT "property_person_role_id" PRIMARY KEY ("id");

ALTER TABLE "property_type"
    ADD CONSTRAINT "property_type_id" PRIMARY KEY ("id");

ALTER TABLE "tarifaccess"
    ADD CONSTRAINT "tarifaccess_id" PRIMARY KEY ("id");

ALTER TABLE "tarifitemacct"
    ADD CONSTRAINT "tarifitemacct_id" PRIMARY KEY ("id");

ALTER TABLE "tarifitemrate"
    ADD CONSTRAINT "tarifitemrate_id" PRIMARY KEY ("id");

ALTER TABLE "tarifitemtype"
    ADD CONSTRAINT "tarifitemtype_id" PRIMARY KEY ("id");

ALTER TABLE "tarifitemunit"
    ADD CONSTRAINT "tarifitemunit_id" PRIMARY KEY ("id");

ALTER TABLE "tarifpartner"
    ADD CONSTRAINT "tarifpartner_id" PRIMARY KEY ("id");

ALTER TABLE "task"
    ADD CONSTRAINT "task_id" PRIMARY KEY ("id");

ALTER TABLE "task_calc"
    ADD CONSTRAINT "task_calc_id" PRIMARY KEY ("id");

ALTER TABLE "task_calc_item"
    ADD CONSTRAINT "task_calc_item_id" PRIMARY KEY ("id");

ALTER TABLE "task_calc_type"
    ADD CONSTRAINT "task_calc_type_id" PRIMARY KEY ("id");

ALTER TABLE "task_location"
    ADD CONSTRAINT "task_location_id" PRIMARY KEY ("id");

ALTER TABLE "task_person"
    ADD CONSTRAINT "task_person_id" PRIMARY KEY ("id");

ALTER TABLE "task_priority"
    ADD CONSTRAINT "task_priority_id" PRIMARY KEY ("id");

ALTER TABLE "task_status"
    ADD CONSTRAINT "task_status_id" PRIMARY KEY ("id");

ALTER TABLE "task_tag"
    ADD CONSTRAINT "task_tag_id" PRIMARY KEY ("id");

ALTER TABLE "task_tag_relation"
    ADD CONSTRAINT "task_tag_relation_id" PRIMARY KEY ("id");

ALTER TABLE "task_tarifitem_role"
    ADD CONSTRAINT "task_tarifitem_role_id" PRIMARY KEY ("id");

ALTER TABLE "task_type"
    ADD CONSTRAINT "task_type_id" PRIMARY KEY ("id");
