{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Identity/issues/780","repository_url":"https://api.github.com/repos/aspnet/Identity","labels_url":"https://api.github.com/repos/aspnet/Identity/issues/780/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Identity/issues/780/comments","events_url":"https://api.github.com/repos/aspnet/Identity/issues/780/events","html_url":"https://github.com/aspnet/Identity/issues/780","id":142759583,"number":780,"title":"How would I change the primary keys in the identity tables to int instead of string?","user":{"login":"rowanmiller","id":4741851,"avatar_url":"https://avatars.githubusercontent.com/u/4741851?v=3","gravatar_id":"","url":"https://api.github.com/users/rowanmiller","html_url":"https://github.com/rowanmiller","followers_url":"https://api.github.com/users/rowanmiller/followers","following_url":"https://api.github.com/users/rowanmiller/following{/other_user}","gists_url":"https://api.github.com/users/rowanmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/rowanmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rowanmiller/subscriptions","organizations_url":"https://api.github.com/users/rowanmiller/orgs","repos_url":"https://api.github.com/users/rowanmiller/repos","events_url":"https://api.github.com/users/rowanmiller/events{/privacy}","received_events_url":"https://api.github.com/users/rowanmiller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Identity/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"HaoK","id":6537861,"avatar_url":"https://avatars.githubusercontent.com/u/6537861?v=3","gravatar_id":"","url":"https://api.github.com/users/HaoK","html_url":"https://github.com/HaoK","followers_url":"https://api.github.com/users/HaoK/followers","following_url":"https://api.github.com/users/HaoK/following{/other_user}","gists_url":"https://api.github.com/users/HaoK/gists{/gist_id}","starred_url":"https://api.github.com/users/HaoK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaoK/subscriptions","organizations_url":"https://api.github.com/users/HaoK/orgs","repos_url":"https://api.github.com/users/HaoK/repos","events_url":"https://api.github.com/users/HaoK/events{/privacy}","received_events_url":"https://api.github.com/users/HaoK/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/aspnet/Identity/milestones/19","html_url":"https://github.com/aspnet/Identity/milestones/1.0.0-rc2","labels_url":"https://api.github.com/repos/aspnet/Identity/milestones/19/labels","id":1369200,"number":19,"title":"1.0.0-rc2","description":null,"creator":{"login":"rustd","id":1132652,"avatar_url":"https://avatars.githubusercontent.com/u/1132652?v=3","gravatar_id":"","url":"https://api.github.com/users/rustd","html_url":"https://github.com/rustd","followers_url":"https://api.github.com/users/rustd/followers","following_url":"https://api.github.com/users/rustd/following{/other_user}","gists_url":"https://api.github.com/users/rustd/gists{/gist_id}","starred_url":"https://api.github.com/users/rustd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustd/subscriptions","organizations_url":"https://api.github.com/users/rustd/orgs","repos_url":"https://api.github.com/users/rustd/repos","events_url":"https://api.github.com/users/rustd/events{/privacy}","received_events_url":"https://api.github.com/users/rustd/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":39,"state":"closed","created_at":"2015-10-21T21:38:11Z","updated_at":"2016-06-16T18:14:55Z","due_on":null,"closed_at":"2016-05-18T21:18:30Z"},"comments":10,"created_at":"2016-03-22T19:49:57Z","updated_at":"2016-06-16T18:23:53Z","closed_at":null,"body":"Porting a question from the EF repo (https://github.com/aspnet/EntityFramework/issues/4879) asked by @TDK1964...\r\n\r\nHow would I change the primary keys in the identity tables to int instead of string?\r\n\r\nI basically want to change all the string Guids PK's to int so this would include IdentityUserRole,IdentityUserLogin,IdentityUserClaim,IdentityRole,ApplicationUser (or should that be IdentityUser?)\r\n\r\nI also want to change the table names to \r\n\r\n```\r\nbuilder.Entity<ApplicationUser>().ForSqlServerToTable().Table(\"Users\");\r\nbuilder.Entity<IdentityUserRole<string>>().ForSqlServerToTable(\"UserRoles\");\r\nbuilder.Entity<IdentityUserLogin<string>>().ForSqlServerToTable(\"UserLogins\");\r\nbuilder.Entity<IdentityUserClaim<string>>().ForSqlServerToTable(\"UserClaims\");\r\nbuilder.Entity<IdentityRole>().ForSqlServerToTable(\"Roles\");\r\n```\r\nI have tried .ToTable(\"...\") but this doesn't work either."},"comment":{"url":"https://api.github.com/repos/aspnet/Identity/issues/comments/226570716","html_url":"https://github.com/aspnet/Identity/issues/780#issuecomment-226570716","issue_url":"https://api.github.com/repos/aspnet/Identity/issues/780","id":226570716,"user":{"login":"SteveSandersonMS","id":1101362,"avatar_url":"https://avatars.githubusercontent.com/u/1101362?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveSandersonMS","html_url":"https://github.com/SteveSandersonMS","followers_url":"https://api.github.com/users/SteveSandersonMS/followers","following_url":"https://api.github.com/users/SteveSandersonMS/following{/other_user}","gists_url":"https://api.github.com/users/SteveSandersonMS/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveSandersonMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveSandersonMS/subscriptions","organizations_url":"https://api.github.com/users/SteveSandersonMS/orgs","repos_url":"https://api.github.com/users/SteveSandersonMS/repos","events_url":"https://api.github.com/users/SteveSandersonMS/events{/privacy}","received_events_url":"https://api.github.com/users/SteveSandersonMS/received_events","type":"User","site_admin":false},"created_at":"2016-06-16T18:23:53Z","updated_at":"2016-06-16T18:23:53Z","body":"I'm doing some verification for the ASP.NET Identity features and have not been successful in getting the Identity DB to change the user ID type from guid to int. If this is going to be a common scenario, we may need better docs.\r\n\r\nI tried doing what's described above by @TDK1964, but it ends up producing the error:\r\n\r\n```\r\nSystem.TypeLoadException\r\nGenericArguments[0], 'WebApplication1.Data.ApplicationUser', on 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.UserStore`8[TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken]' violates the constraint of type parameter 'TUser'.\r\n\r\nat System.RuntimeTypeHandle.Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type)\r\n \r\nat System.RuntimeTypeHandle.Instantiate(Type[] inst)\r\n \r\nat System.RuntimeType.MakeGenericType(Type[] instantiation)\r\n```\r\n\r\nI don't know why this type error occurs at runtime, given that there was no build error. I'm using the 21343 (6/11) build.\r\n\r\nSo, is this a scenario we need to support, and if so, can you provide instructions for doing it? Have I missed where this is documented, or should I file an issue for it to be documented? Thanks!"}}
{"actor":{"display_login":"SteveSandersonMS"}}