Entity framework code first migrations, sql user permissions?

前端 未结 2 547
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 12:14

What is the minimal permission needed on a sql server user/login for it to be able to run entity framework code first database migrations?

I naively would have thought t

2条回答
  •  没有蜡笔的小新
    2021-02-05 12:54

    Clearly it depends on what your migrations are/(will be) doing. For my use case, I ended up creating a shema, and restricting the user that the migration uses to the permissions below.

    GRANT ALTER, INSERT, SELECT, DELETE, UPDATE, REFERENCES ON SCHEMA::schema_name TO migration_user
    GRANT CREATE TABLE TO migration_user
    

提交回复
热议问题