-- Jalankan jika kolom integrasi mitra belum ada di tabel proyek.
-- Pastikan tabel mitra dan mitra_pic sudah ada.

ALTER TABLE proyek
ADD COLUMN id_mitra BIGINT NULL AFTER id_kontak_person,
ADD COLUMN id_pic_mitra BIGINT NULL AFTER id_mitra;

-- Opsional, tambahkan index untuk mempercepat join.
ALTER TABLE proyek
ADD INDEX idx_proyek_id_mitra (id_mitra),
ADD INDEX idx_proyek_id_pic_mitra (id_pic_mitra);

-- Opsional jika engine dan tipe data sama-sama mendukung FK.
-- ALTER TABLE proyek
-- ADD CONSTRAINT fk_proyek_mitra
-- FOREIGN KEY (id_mitra) REFERENCES mitra(id_mitra)
-- ON DELETE SET NULL ON UPDATE CASCADE;
--
-- ALTER TABLE proyek
-- ADD CONSTRAINT fk_proyek_mitra_pic
-- FOREIGN KEY (id_pic_mitra) REFERENCES mitra_pic(id_pic)
-- ON DELETE SET NULL ON UPDATE CASCADE;
