- First run this command into adonisJS =>
node ace data:migrate > output.txt
- You got output.txt with all commands that has to run. test this script on local system using backups of old and new, and finally you will get the exact order of execution regarding internal foreign key refernce.
- Now let's do this on production db. generate a temp db as source_db and run this command with ofcource change the actual db names(source_db and dest_db).
P.S.:: I know one branch which is accidentally deleted was const branchId = 345
on const mainTable = 'branches'
write your init logic according to that.