ALTER TABLE replicants_stats
    DROP CONSTRAINT IF EXISTS replicants_stats_replicant_id_fkey;

ALTER TABLE replicants_stats
    ADD CONSTRAINT replicants_stats_replicant_id_fkey
        FOREIGN KEY (replicant_id) REFERENCES replicants(id);

ALTER TABLE replicants
    DROP CONSTRAINT IF EXISTS replicants_corp_id_fkey;

ALTER TABLE replicants
    ADD CONSTRAINT replicants_corp_id_fkey
        FOREIGN KEY (corp_id) REFERENCES corps(id);

ALTER TABLE users
    DROP CONSTRAINT IF EXISTS users_corp_id_fkey;

ALTER TABLE users
    ADD CONSTRAINT users_corp_id_fkey
        FOREIGN KEY (corp_id) REFERENCES corps(id);
