fix: implement down in add-loan-events-missing-indexes to drop indexes#1290
Conversation
|
reviewed the content and it's good: the down() drops exactly the four indexes the up() creates (created_at, loan_id_event_type, event_type, borrower) with IF EXISTS, and i verified the full up -> down-all -> up-again cycle applies cleanly on postgres against the current migration set. two things before it can merge:
non-blocking: idx_loan_events_loan_id_event_type is also created by the earlier 1777 composite-indexes migration, so a partial rollback of just 1788 would drop an index 1777 also owns, the IF EXISTS guards keep it safe but it's worth a one-line comment. rebase + drop the md and i'll merge. if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0 |
ogazboiz
left a comment
There was a problem hiding this comment.
the down() is correct (drops exactly the four indexes the up() creates, all IF EXISTS), and you dropped the stray pr_body file and rebased, so it's clean and green on current main now. merging.
if you want to keep contributing, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0
Closes #1193
What does this PR do?
This PR implements the missing
down()function in the1788000000018_add-loan-events-missing-indexes.jsmigration file, which previously leaked four database indexes on rollback.Description
down = () => {}with explicitDROP INDEX IF EXISTSstatements for all four indexes (idx_loan_events_borrower,idx_loan_events_event_type,idx_loan_events_loan_id_event_type, andidx_loan_events_created_at) created in theup()function.