This was discussed yesterday . The migration commands are dependent on your production database because they interact with the __MigrationHistory
table to get the actual state and correctly calculate what changes need to be made.
If you just need to create scripts, you can do this using Update-Database with additional parameters:
Create a script for the entire database:
Update-Database -Script -SourceMigration:$InitialDatabase
Create a script to move from migration A to migration B:
Update-Database -Script -SourceMigration:"A" -TargetMigration:"B"
source share