-- vazby contract_item na ine tabulky
\encoding UTF8
INSERT INTO contract_item_binding (name,sqldb,sqltable,sqlcolumn) VALUES ('SIP kontá','ipfon','ipfon_account','username');
INSERT INTO contract_item_binding (name,sqldb,sqltable,sqlcolumn) VALUES ('Tel. čísla','ipfon','ipfon_telno','telno');
INSERT INTO contract_item_binding (name,sqldb,sqltable,sqlcolumn) VALUES ('Virtuálne FAX kontá','ipfon','ipfon_fax_account','username');
INSERT INTO contract_item_binding (name,sqldb,sqltable,sqlcolumn) VALUES ('RegioTV settopboxy','regiotv','rtv_stb','id');
INSERT INTO contract_item_binding (name,sqldb,sqltable,sqlcolumn) VALUES ('RegioTV balíčky ku zmluve','regiotv','rtv_contract_package','id');

GRANT SELECT ON contract_item_binding TO extranet;
INSERT INTO acl (permit_select, dataset_name) values (true, 'contract_item_binding');

-- zriadovaci poplatok pre tarifitem (setup_fee)

ALTER TABLE tarifitem ADD COLUMN setup_fee_tarifitem INT REFERENCES tarifitem (id) ON UPDATE CASCADE ON DELETE RESTRICT;
COMMENT ON COLUMN tarifitem.setup_fee_tarifitem IS 'zriadovaci poplatok ku polozke - odkaz na ID z tarifitem';
