From 169296f47f0f61d93386e26082dba6400f1b0068 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Tue, 25 Aug 2020 10:44:58 -0700 Subject: [PATCH] Migrations: Don't let --output-dir override the existing snapshot location Note, --output-dir is still used to determine the directory on the first migration. Fixes #13342 --- src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs b/src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs index 72465a28c51..6fbe4994f3c 100644 --- a/src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs +++ b/src/EFCore.Design/Migrations/Design/MigrationsScaffolder.cs @@ -393,7 +393,7 @@ public virtual MigrationFiles Save(string projectDir, ScaffoldedMigration migrat var migrationFile = Path.Combine(migrationDirectory, migration.MigrationId + migration.FileExtension); var migrationMetadataFile = Path.Combine(migrationDirectory, migration.MigrationId + ".Designer" + migration.FileExtension); var modelSnapshotFileName = migration.SnapshotName + migration.FileExtension; - var modelSnapshotDirectory = outputDir ?? GetDirectory(projectDir, modelSnapshotFileName, migration.SnapshotSubnamespace); + var modelSnapshotDirectory = GetDirectory(projectDir, modelSnapshotFileName, migration.SnapshotSubnamespace); var modelSnapshotFile = Path.Combine(modelSnapshotDirectory, modelSnapshotFileName); Dependencies.OperationReporter.WriteVerbose(DesignStrings.WritingMigration(migrationFile));