can't run Craft CLI (php craft migrate/create) from the plugin folder (as opposed to the project folder)
From the project folder run:
php craft migrate/create my_migration_name --plugin=my-plugin-handle
https://craftcms.com/docs/4.x/extend/migrations.html#creating-migrations
If I add a migration manually to the migrations folder of the plugin I can't get the root project to identify and run it.
I have managed to run it manually:
php craft migrate --plugin=my-plugin-handle
For Craft to run the new migration on update you need to increase the schemaVersion of the plugin under the Plugin Class (Defaults to 1.0.0). e.g:
public string $schemaVersion = '1.0.1';
However, it seems that migration needs to be added to Install migration as well for fresh installations, which would require code duplication or extracting the migration into a service class or trait. Though I can't see this pattern followed in Craft Commerce for example (https://github.com/craftcms/commerce/tree/develop/src/migrations).