Reputation: 122
I would like to ask you if it is possible to proceed (in entity framework core):
context.Database.Migrate();
using database user without ddladmin permissions?
What I would like to achieve:
User without permission should not update migrations (without errors). However users with those kinds of permissions should be able to make migrations.
Currently, I am getting this kind of errors:
System.Private.CoreLib: Exception while executing function: xxx. Core Microsoft SqlClient Data Provider: CREATE TABLE permission denied in database 'xxxx'.
Upvotes: 2
Views: 663
Reputation: 4244
You have two options:
You give the user the db_ddladmin
role
You add the create table
grant to the user, like GRANT CREATE TABLE TO Joe AS dbo
I think the second one is what you are looking for.
Upvotes: 1