DROP TRIGGER IF EXISTS trg_verifications_reference_number ON verifications;
DROP TRIGGER IF EXISTS trg_support_tickets_reference_number ON support_tickets;
DROP TRIGGER IF EXISTS trg_payments_reference_number ON payments;
DROP TRIGGER IF EXISTS trg_users_reference_number ON users;

DROP FUNCTION IF EXISTS set_verification_reference_number();
DROP FUNCTION IF EXISTS set_ticket_reference_number();
DROP FUNCTION IF EXISTS set_payment_reference_number();
DROP FUNCTION IF EXISTS set_user_reference_number();

ALTER TABLE verifications DROP COLUMN IF EXISTS reference_number;
ALTER TABLE support_tickets DROP COLUMN IF EXISTS reference_number;
ALTER TABLE payments DROP COLUMN IF EXISTS reference_number;
ALTER TABLE users DROP COLUMN IF EXISTS reference_number;

DROP SEQUENCE IF EXISTS verification_number_seq;
DROP SEQUENCE IF EXISTS ticket_number_seq;
DROP SEQUENCE IF EXISTS payment_number_seq;
DROP SEQUENCE IF EXISTS user_number_seq;
