{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/EntityFramework/issues/6978","repository_url":"https://api.github.com/repos/aspnet/EntityFramework","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/6978/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/6978/comments","events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/6978/events","html_url":"https://github.com/aspnet/EntityFramework/issues/6978","id":188301358,"number":6978,"title":"Changing PK Identity Column to DatabaseGeneratedOption.None does not generate correct migration for SQL server","user":{"login":"nh43de","id":7240342,"avatar_url":"https://avatars.githubusercontent.com/u/7240342?v=3","gravatar_id":"","url":"https://api.github.com/users/nh43de","html_url":"https://github.com/nh43de","followers_url":"https://api.github.com/users/nh43de/followers","following_url":"https://api.github.com/users/nh43de/following{/other_user}","gists_url":"https://api.github.com/users/nh43de/gists{/gist_id}","starred_url":"https://api.github.com/users/nh43de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nh43de/subscriptions","organizations_url":"https://api.github.com/users/nh43de/orgs","repos_url":"https://api.github.com/users/nh43de/repos","events_url":"https://api.github.com/users/nh43de/events{/privacy}","received_events_url":"https://api.github.com/users/nh43de/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-09T17:10:31Z","updated_at":"2016-11-09T17:10:31Z","closed_at":null,"body":"### Steps to reproduce\r\n\r\n1. Create a new empty project (I used sample web application, with net46, and individual user accounts). \r\n2. Create a class \"TestClass\", add DbSet<TestClass> to the context and add PK column \"int TestClassId\" to TestClass.\r\n3. Apply attribute \"[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\"\r\n4. Add migration and update database. This column is a PK and identity column.\r\n5. Change database generated option for the PK column \"TestClassId\" to \"[DatabaseGenerated(DatabaseGeneratedOption.None)]\".\r\n6. Add migration and update database. \r\n\r\nThe migration that is generated does not remove the identity from the PK column. My guess is that this would require a tree traversal to determine how to handle rebuilding of FK relationships, or would require table rebuilds i.e. #329.\r\n\r\n\r\n### Further technical details\r\n\r\nOperating system: Windows 10\r\nVisual Studio version: 2015\r\nOther details: created sample web application, using net46 and individual user accounts. \r\nEF Core project dependencies: \r\n    \"Microsoft.EntityFrameworkCore.SqlServer: \"1.0.1\",\r\n    \"Microsoft.EntityFrameworkCore.SqlServer.Design\": {\r\n      \"version\": \"1.0.1\",\r\n      \"type\": \"build\"\r\n    },\r\n    \"Microsoft.EntityFrameworkCore.Tools\": {\r\n      \"version\": \"1.0.0-preview2-final\",\r\n      \"type\": \"build\"\r\n    }"}}
{"actor":{"display_login":"nh43de"}}