iKhokha integration complete
This commit is contained in:
14
scripts/ikhokha_migrations/002_migrate_efts_to_payments.sql
Normal file
14
scripts/ikhokha_migrations/002_migrate_efts_to_payments.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- Migration: copy existing efts records into payments for historical continuity
|
||||
-- This inserts EFT records into payments table as payments with provider='eft'.
|
||||
-- Run only after verifying step 001 has been applied and a backup exists.
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT IGNORE INTO `payments` (`payment_id`, `user_id`, `amount`, `status`, `date`, `description`, `provider`, `provider_payment_id`, `provider_status`)
|
||||
SELECT `eft_id`, `user_id`, `amount`, `status`, `timestamp`, `description`, 'eft', `eft_id`, `status` FROM `efts`;
|
||||
|
||||
COMMIT;
|
||||
|
||||
-- Notes:
|
||||
-- 1) `INSERT IGNORE` prevents duplicate primary-key errors (payments.payment_id is PK).
|
||||
-- 2) After running, review migrated rows and ensure admin workflows still operate.
|
||||
Reference in New Issue
Block a user