Open ajcvickers opened 9 months ago
Notes from design meeting:
In general, we will honor output-path, including for the snapshot file.
project/11112233445566_M.cs
project/11112233445566_M.Designer.cs
project/Migrations/GnomeContextModelSnapshot.cs
=> project/GnomeContextModelSnapshot.cs
/mydrive/11112233445566_M.cs
/mydrive/11112233445566_M.Designer.cs
project/Migrations/GnomeContextModelSnapshot.cs
=> /mydrive/GnomeContextModelSnapshot.cs
project/outputPath/11112233445566_M.cs
project/outputPath/11112233445566_M.Designer.cs
project/Acme/Packing/GnomeContextModelSnapshot.cs
=> project/outputPath/GnomeContextModelSnapshot.cs
also see #32752 which was confusing to me regarding output path
Adding a new, initial migration "M" results in three new files:
project/Migrations/11112233445566_M.cs
project/Migrations/11112233445566_M.Designer.cs
project/Migrations/GnomeContextModelSnapshot.cs
However, using
--output-path
changes this in non-obvious ways. There are four subcategories:Relative output path
This is presumably the intended use, and the results seem reasonable:
project/outputPath/11112233445566_M.cs
project/outputPath/11112233445566_M.Designer.cs
project/outputPath/GnomeContextModelSnapshot.cs
Empty output path
Note that this is not the same as a
null
output path, and is not blocked. Presumably, it should mean either the same asnull
or it should mean don't useMigrations
, which is the default, and instead just put the files directly in the project root. We actually do half and half:project/11112233445566_M.cs
project/11112233445566_M.Designer.cs
project/Migrations/GnomeContextModelSnapshot.cs
Notice that the snapshot still goes into "Migrations", but the other files go in the project root.
Absolute output path
It's not clear to me that this was ever intentional, but it is not blocked. I assume people will do this because they want to explicitly place the files somewhere outside the project.
Given the absolute output path
/mydrive
, the files generated are:/mydrive/11112233445566_M.cs
/mydrive/11112233445566_M.Designer.cs
project/Migrations/GnomeContextModelSnapshot.cs
Notice that snapshot file is not in the output path (it's still relative to the project) and is in the "Migrations" folder.
Output path and namespace set
When the
--namespace
option is also used, then it impacts some paths but not others. For example, with--namespace Acme.Packing --output-dir outputDir
:project/outputPath/11112233445566_M.cs
project/outputPath/11112233445566_M.Designer.cs
project/Acme/Packing/GnomeContextModelSnapshot.cs
Notice that the snapshot goes into a folder named for the namespace, but the other files go into the output path.
FYI, the result of using
namespace
without output-path is:project/Acme/Packing/11112233445566_M.cs
project/Acme/Packing/11112233445566_M.Designer.cs
project/Acme/Packing/GnomeContextModelSnapshot.cs