-- presun obsahu stlpca tarif.supplier (int) do tabulky tarifaccess.pid (int) + tarifaccess.supplier (bool)

BEGIN;

ALTER TABLE tarifaccess ADD COLUMN supplier BOOLEAN NOT NULL DEFAULT FALSE;
INSERT INTO tarifaccess (tarif, pid, supplier) SELECT t.id AS tarif, p.pid, TRUE AS supplier FROM tarif t, person p WHERE p.id=t.supplier;
ALTER TABLE tarif DROP COLUMN supplier;

COMMIT;
