{"action":"created","issue":{"url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99","repository_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql","labels_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99/comments","events_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99/events","html_url":"https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99","id":186011950,"number":99,"title":"MigrationHistory table from EntityFramework is not generated on database update/Specified key was too long","user":{"login":"DMWOO7","id":21245043,"avatar_url":"https://avatars.githubusercontent.com/u/21245043?v=3","gravatar_id":"","url":"https://api.github.com/users/DMWOO7","html_url":"https://github.com/DMWOO7","followers_url":"https://api.github.com/users/DMWOO7/followers","following_url":"https://api.github.com/users/DMWOO7/following{/other_user}","gists_url":"https://api.github.com/users/DMWOO7/gists{/gist_id}","starred_url":"https://api.github.com/users/DMWOO7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DMWOO7/subscriptions","organizations_url":"https://api.github.com/users/DMWOO7/orgs","repos_url":"https://api.github.com/users/DMWOO7/repos","events_url":"https://api.github.com/users/DMWOO7/events{/privacy}","received_events_url":"https://api.github.com/users/DMWOO7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-28T20:16:45Z","updated_at":"2016-10-29T13:15:24Z","closed_at":null,"body":"Hello,\r\n\r\nI wrote an ASP.NET Core MVC application using Pomelo.EntityFrameworkCore.MySql. I also used migrations, which works on my Windows 10 dev-machine. For testing reasons, I started the app on a Ubuntu 16.04.1 VM as surely the app should run on a linux server later. But it seems that the initial creation of the tables which had worked fine under windows has some issues here. \r\n\r\n```\r\n$ sudo dotnet ef database update\r\nProject MyProject (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.\r\nPomelo.Data.MySql.MySqlException: Table 'myDatabase.__efmigrationshistory' doesn't exist\r\n   at Pomelo.Data.MySql.MySqlStream.ReadPacket()\r\n   at Pomelo.Data.MySql.NativeDriver.GetResult(Int64& affectedRow, Int64& insertedId)\r\n   at Pomelo.Data.MySql.Driver.NextResult(Int32 statementId, Boolean force)\r\n   at Pomelo.Data.MySql.MySqlDataReader.NextResult()\r\n   at Pomelo.Data.MySql.MySqlCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary`2 parameterValues, Boolean openConnection, Boolean closeConnection)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues, Boolean manageConnection)\r\n   at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrations()\r\n   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)\r\n   at Microsoft.EntityFrameworkCore.Design.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)\r\n   at Microsoft.EntityFrameworkCore.Tools.Cli.DatabaseUpdateCommand.<>c__DisplayClass0_0.<Configure>b__0()\r\n   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)\r\n   at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)\r\nTable 'myDatabase.__efmigrationshistory' doesn't exist\r\n```\r\n\r\nI tried to create the table manually using the following SQL \r\n\r\n```\r\nCREATE TABLE `__efmigrationshistory` (\r\n  `MigrationId` varchar(150) NOT NULL,\r\n  `ProductVersion` varchar(32) NOT NULL\r\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r\n```\r\n\r\nThis gave me another exception: \r\n\r\n```\r\n$ sudo dotnet ef database update\r\nProject MyProject (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.\r\nPomelo.Data.MySql.MySqlException: Specified key was too long; max key length is 767 bytes\r\n   at Pomelo.Data.MySql.MySqlStream.ReadPacket()\r\n   at Pomelo.Data.MySql.NativeDriver.GetResult(Int64& affectedRow, Int64& insertedId)\r\n   at Pomelo.Data.MySql.Driver.NextResult(Int32 statementId, Boolean force)\r\n   at Pomelo.Data.MySql.MySqlDataReader.NextResult()\r\n   at Pomelo.Data.MySql.MySqlCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Pomelo.Data.MySql.MySqlCommand.ExecuteNonQuery()\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, String executeMethod, IReadOnlyDictionary`2 parameterValues, Boolean openConnection, Boolean closeConnection)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues, Boolean manageConnection)\r\n   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)\r\n   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)\r\n   at Microsoft.EntityFrameworkCore.Design.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)\r\n   at Microsoft.EntityFrameworkCore.Tools.Cli.DatabaseUpdateCommand.<>c__DisplayClass0_0.<Configure>b__0()\r\n   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)\r\n   at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)\r\nSpecified key was too long; max key length is 767 bytes\r\n```\r\n\r\n**Details about the environment (ubuntu machine)**\r\n\r\n```\r\n$ lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription:    Ubuntu 16.04.1 LTS\r\nRelease:        16.04\r\nCodename:       xenial\r\n\r\n```\r\n\r\n```\r\n$ dotnet --version\r\n1.0.0-preview2-003121\r\n```\r\nUsed Version of Pomelo.EntityFrameworkCore.MySql: 1.0.0\r\nSQL-Server: MariaDB 10.1 x64 running on Windows"},"comment":{"url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/comments/257091069","html_url":"https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99#issuecomment-257091069","issue_url":"https://api.github.com/repos/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/issues/99","id":257091069,"user":{"login":"Kagamine","id":2216750,"avatar_url":"https://avatars.githubusercontent.com/u/2216750?v=3","gravatar_id":"","url":"https://api.github.com/users/Kagamine","html_url":"https://github.com/Kagamine","followers_url":"https://api.github.com/users/Kagamine/followers","following_url":"https://api.github.com/users/Kagamine/following{/other_user}","gists_url":"https://api.github.com/users/Kagamine/gists{/gist_id}","starred_url":"https://api.github.com/users/Kagamine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kagamine/subscriptions","organizations_url":"https://api.github.com/users/Kagamine/orgs","repos_url":"https://api.github.com/users/Kagamine/repos","events_url":"https://api.github.com/users/Kagamine/events{/privacy}","received_events_url":"https://api.github.com/users/Kagamine/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T13:15:24Z","updated_at":"2016-10-29T13:15:24Z","body":"Which charset are you using? Our type mapper is designed for utf8. MySQL has limited the max PK length to be 767 bytes. So we set 255 as the default string PK length."}}
{"actor":{"display_login":"Kagamine"}}