Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an empty file migration in Illegal character filename in add-migration #24024

Closed
Ali-YousefiTelori opened this issue Jan 29, 2021 · 3 comments · Fixed by #32589
Closed
Assignees
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-6.0 type-bug

Comments

@Ali-YousefiTelori
Copy link
Contributor

When you try to run this command in your Package Manager Console you will get the error to add immigration but you will see the empty file created in your migration folder:

add-migration "to fix error: add column is_deleted"

However, I cannot find commands of add-migration in ef core sources so I cannot fix this bug. if you guys tell me where is source of ef core design or tools maybe we can develop it.
Thank you

@ajcvickers
Copy link
Member

@Ali-YousefiTelori Can you provide an example of using a illegal character and give more details on the empty file created?

@Ali-YousefiTelori
Copy link
Contributor Author

@ajcvickers you do not need an example, you can run that command in every project that will create an empty file in the migration folder

add-migration "to fix error: add column is_deleted"

@ajcvickers
Copy link
Member

@bricelam Confirmed empty file is created, for this example with name "20210202212632_to fix error".

Output:

PM> add-migration "to fix error: add column is_deleted"
Build started...
Build succeeded.
To undo this action, use Remove-Migration.
add-migration : Exception calling "AddFromFile" with "1" argument(s): "The given path's format is not supported."
At line:1 char:1
+ add-migration "to fix error: add column is_deleted"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Migration], MethodInvocationException
    + FullyQualifiedErrorId : NotSupportedException,Add-Migration
 
PM> 

@AndriySvyryd AndriySvyryd added this to the 6.0.0 milestone Feb 5, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0, Backlog Jul 30, 2021
@bricelam bricelam removed their assignment Jul 8, 2023
@ajcvickers ajcvickers self-assigned this Dec 11, 2023
@ajcvickers ajcvickers modified the milestones: Backlog, 9.0.0 Dec 11, 2023
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Dec 11, 2023
ajcvickers added a commit that referenced this issue Dec 11, 2023
ajcvickers added a commit that referenced this issue Dec 12, 2023
ajcvickers added a commit that referenced this issue Dec 12, 2023
* Validate scaffolding migration file names

Fixes #24024

* Use TempDirectory class

* Skip negative cases on non-Windows.

* Exclude more tests from non-Windows platforms
@ajcvickers ajcvickers modified the milestones: 9.0.0, 9.0.0-preview1 Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-6.0 type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants