-- PORTMAN - run ONLY on the TEST database (the copy), never on the live one.
-- 1. Every phone number in the copy becomes YOUR number, so even if some page still
--    sends a message, it can only reach you, never staff, drivers or agents.
--    Change 255762222888 below to the test phone you want, then run.
SET @test_phone = '255762222888';
UPDATE approval_contacts SET phone_number = @test_phone WHERE phone_number NOT LIKE '%@g.us';
UPDATE approval_contacts SET is_active = 0 WHERE phone_number LIKE '%@g.us';     -- no WhatsApp groups from the test copy
UPDATE users SET phone_number = @test_phone WHERE phone_number IS NOT NULL AND phone_number <> '';
UPDATE payment_vouchers SET receiver_phone = @test_phone WHERE receiver_phone IS NOT NULL AND receiver_phone <> '';
UPDATE credit_notes SET recipient_phone = @test_phone WHERE recipient_phone IS NOT NULL AND recipient_phone <> '';
-- (drivers table last: if it has no 'phone' column on your copy, this line can be skipped)
UPDATE drivers SET phone = @test_phone WHERE phone IS NOT NULL AND phone <> '';
-- 2. A marker you can see in phpMyAdmin, so nobody confuses the two databases.
CREATE TABLE IF NOT EXISTS zz_THIS_IS_THE_TEST_DATABASE (note VARCHAR(100));
INSERT INTO zz_THIS_IS_THE_TEST_DATABASE VALUES (CONCAT('Test copy made on ', NOW()));
