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

Log warning when credentials used for reverse engineering does not have view definition rights #26776

Merged
merged 13 commits into from
Dec 13, 2021

Conversation

ErikEJ
Copy link
Contributor

@ErikEJ ErikEJ commented Nov 21, 2021

fixes #22842

@ErikEJ ErikEJ changed the title Log warning when credentials used for reverse eniginnering does not have view definition rights Log warning when credentials used for reverse enigineering does not have view definition rights Nov 21, 2021
@@ -70,7 +70,8 @@ private enum Id
ReflexiveConstraintIgnored,
DuplicateForeignKeyConstraintIgnored,
ColumnWithoutTypeWarning,
ForeignKeyReferencesUnknownPrincipalTableWarning
ForeignKeyReferencesUnknownPrincipalTableWarning,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 36 and 37 here looks like an error waiting to happen...
Maybe they should be removed?

@@ -248,6 +248,10 @@
<value>Unable to find a table in the database matching the selected table '{table}'.</value>
<comment>Warning SqlServerEventId.MissingTableWarning string?</comment>
</data>
<data name="LogMissingViewDefinitionRights" xml:space="preserve">
<value>Aspects of your schema definition may be missing, as the credentials in use has not been granted 'VIEW DEFINITION' rights.</value>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions for phrasing this?

Copy link
Contributor Author

@ErikEJ ErikEJ Nov 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be:
Unable to fully reverse engineer your database, because the credentials used have not been granted 'VIEW DEFINITION' rights for the database.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @dotnet/efteam for warning message review.

Copy link
Member

@ajcvickers ajcvickers Dec 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about, "The database user has not been granted 'VIEW DEFINITION' rights. Scaffolding requires these rights to construct the Entity Framework model correctly. Without these rights, parts of the scaffolded model may be missing, resulting in incorrect interactions between Entity Framework and the database at runtime."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, maybe just "parts" iso "the parts"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ErikEJ Corrected inline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the message now

@smitpatel smitpatel merged commit 98a1153 into dotnet:main Dec 13, 2021
@smitpatel
Copy link
Member

Thank you @ErikEJ

@ajcvickers ajcvickers changed the title Log warning when credentials used for reverse enigineering does not have view definition rights Log warning when credentials used for reverse engineering does not have view definition rights Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet ef dbcontext scaffold doesn't work with computed columns unless user is db_owner
3 participants