I have a very weird behavior happening whenever I run "truffle migrate". Ideally, as per the documentation, it states:
This will run all migrations located within your project's migrations directory. At their simplest, migrations are simply a set of managed deployment scripts. If your migrations were previously run successfully, truffle migrate will start execution from the last migration that ran, running only newly created migrations. If no new migrations exist, truffle migrate won't perform any action at all
But for me, on the contrary, it's running all migration every time i.e. starting from 1_initial_migration till the last migration file I have. I am using Ganache for local testing. Is it something related to the code setup or am I missing anything important that needs to be done for migration.
Output of running truffle migrate:
Using network 'development'. Running migration: 1_initial_migration.js Replacing Migrations... ...0xf698fa2021847daaef0cedfc008976fbcc499eafc6f9c1eac6cc011faca77593 Migrations: 0xecfcab0a285d3380e488a39b4bb21e777f8a4eac Saving successful migration to network... ... 0x64df98e7d3f1cf5dc7eaa5264011714bf49802d9fda56003e202434903c2581b Saving artifacts... Running migration: 2_factory_name_registry_migration.js Didn't deploy FactoryNameRegistry; using 0x345ca3e014aaf5dca488057592ee47305d9b3e10 ...0x0f90f0c9086735cd74a83b30f597fa5363764eb8920d5ae0b47cb6b3267be627 Saving successful migration to network... ... 0xf048fc893066a845ec584920ab57630b213db48a619e85fc12f8d3e966fb3525 ...0x81a7a0b188eadb39e207bd22fb3598830d166beb6b3f3bc7852f73dd303af6ef Saving artifacts...
Edit: this is happening without restarting Ganache, as I do understand restarting the server will cause this behaviour to happen naturally