{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/comments/57382727","id":57382727,"diff_hunk":"@@ -196,107 +207,76 @@ public virtual void Migrate(string targetMigration = null)\n             string toMigration = null,\n             bool idempotent = false)\n         {\n-            var migrations = _migrationsAssembly.Migrations;\n+            var firstMigrationId = _migrationsAssembly.Migrations.Select(t => t.Key).FirstOrDefault();\n+            var skippedMigrations = _migrationsAssembly.Migrations\n+                .Where(t => string.Compare(t.Key, fromMigration, StringComparison.OrdinalIgnoreCase) < 0)\n+                .Select(t => t.Key);\n+\n+            IReadOnlyList<Migration> migrationsToApply, migrationsToRevert;\n+            PopulateMigrations(\n+                skippedMigrations,\n+                toMigration,\n+                out migrationsToApply,\n+                out migrationsToRevert);\n \n-            if (string.IsNullOrEmpty(fromMigration))\n-            {\n-                fromMigration = Migration.InitialDatabase;\n-            }\n-            else if (fromMigration != Migration.InitialDatabase)\n-            {\n-                fromMigration = _migrationsAssembly.GetMigrationId(fromMigration);\n-            }\n+            var builder = new IndentedStringBuilder();\n \n-            if (string.IsNullOrEmpty(toMigration))\n+            if (toMigration == Migration.InitialDatabase || string.IsNullOrEmpty(fromMigration))","path":"src/Microsoft.EntityFrameworkCore.Relational/Migrations/Internal/Migrator.cs","position":125,"original_position":125,"commit_id":"ab3198ead0d254fbc72e9c77e02ec86b4a5a7853","original_commit_id":"ab3198ead0d254fbc72e9c77e02ec86b4a5a7853","user":{"login":"bricelam","id":1226749,"avatar_url":"https://avatars.githubusercontent.com/u/1226749?v=3","gravatar_id":"","url":"https://api.github.com/users/bricelam","html_url":"https://github.com/bricelam","followers_url":"https://api.github.com/users/bricelam/followers","following_url":"https://api.github.com/users/bricelam/following{/other_user}","gists_url":"https://api.github.com/users/bricelam/gists{/gist_id}","starred_url":"https://api.github.com/users/bricelam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bricelam/subscriptions","organizations_url":"https://api.github.com/users/bricelam/orgs","repos_url":"https://api.github.com/users/bricelam/repos","events_url":"https://api.github.com/users/bricelam/events{/privacy}","received_events_url":"https://api.github.com/users/bricelam/received_events","type":"User","site_admin":false},"body":"Amen to that. If you run `build initialize` then open `EntityFramework.sln` it bypasses most of the CLI and Web Tooling workflow and lets you use plain-ol' csproj on Full .NET. You can run the unit tests using [TestDriven.NET](http://testdriven.net/).","created_at":"2016-03-24T20:30:45Z","updated_at":"2016-03-24T20:30:45Z","html_url":"https://github.com/aspnet/EntityFramework/pull/4661#discussion_r57382727","pull_request_url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661","_links":{"self":{"href":"https://api.github.com/repos/aspnet/EntityFramework/pulls/comments/57382727"},"html":{"href":"https://github.com/aspnet/EntityFramework/pull/4661#discussion_r57382727"},"pull_request":{"href":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661","id":61001901,"html_url":"https://github.com/aspnet/EntityFramework/pull/4661","diff_url":"https://github.com/aspnet/EntityFramework/pull/4661.diff","patch_url":"https://github.com/aspnet/EntityFramework/pull/4661.patch","issue_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4661","number":4661,"state":"open","locked":false,"title":"Fix #2942: Script-Migrations throws when no migrations.","user":{"login":"laskoviymishka","id":2754361,"avatar_url":"https://avatars.githubusercontent.com/u/2754361?v=3","gravatar_id":"","url":"https://api.github.com/users/laskoviymishka","html_url":"https://github.com/laskoviymishka","followers_url":"https://api.github.com/users/laskoviymishka/followers","following_url":"https://api.github.com/users/laskoviymishka/following{/other_user}","gists_url":"https://api.github.com/users/laskoviymishka/gists{/gist_id}","starred_url":"https://api.github.com/users/laskoviymishka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laskoviymishka/subscriptions","organizations_url":"https://api.github.com/users/laskoviymishka/orgs","repos_url":"https://api.github.com/users/laskoviymishka/repos","events_url":"https://api.github.com/users/laskoviymishka/events{/privacy}","received_events_url":"https://api.github.com/users/laskoviymishka/received_events","type":"User","site_admin":false},"body":"Add check for empty migrations when create migrate script. \r\nIf so show show error to reporter with message `There is no migration`","created_at":"2016-02-28T18:53:48Z","updated_at":"2016-03-24T20:30:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a0f9b6f77a4dcd91cc780c1fa9a0d91ec61abef","assignee":{"login":"bricelam","id":1226749,"avatar_url":"https://avatars.githubusercontent.com/u/1226749?v=3","gravatar_id":"","url":"https://api.github.com/users/bricelam","html_url":"https://github.com/bricelam","followers_url":"https://api.github.com/users/bricelam/followers","following_url":"https://api.github.com/users/bricelam/following{/other_user}","gists_url":"https://api.github.com/users/bricelam/gists{/gist_id}","starred_url":"https://api.github.com/users/bricelam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bricelam/subscriptions","organizations_url":"https://api.github.com/users/bricelam/orgs","repos_url":"https://api.github.com/users/bricelam/repos","events_url":"https://api.github.com/users/bricelam/events{/privacy}","received_events_url":"https://api.github.com/users/bricelam/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661/commits","review_comments_url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661/comments","review_comment_url":"https://api.github.com/repos/aspnet/EntityFramework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/4661/comments","statuses_url":"https://api.github.com/repos/aspnet/EntityFramework/statuses/ab3198ead0d254fbc72e9c77e02ec86b4a5a7853","head":{"label":"laskoviymishka:noMigrationsIssue","ref":"noMigrationsIssue","sha":"ab3198ead0d254fbc72e9c77e02ec86b4a5a7853","user":{"login":"laskoviymishka","id":2754361,"avatar_url":"https://avatars.githubusercontent.com/u/2754361?v=3","gravatar_id":"","url":"https://api.github.com/users/laskoviymishka","html_url":"https://github.com/laskoviymishka","followers_url":"https://api.github.com/users/laskoviymishka/followers","following_url":"https://api.github.com/users/laskoviymishka/following{/other_user}","gists_url":"https://api.github.com/users/laskoviymishka/gists{/gist_id}","starred_url":"https://api.github.com/users/laskoviymishka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laskoviymishka/subscriptions","organizations_url":"https://api.github.com/users/laskoviymishka/orgs","repos_url":"https://api.github.com/users/laskoviymishka/repos","events_url":"https://api.github.com/users/laskoviymishka/events{/privacy}","received_events_url":"https://api.github.com/users/laskoviymishka/received_events","type":"User","site_admin":false},"repo":{"id":38584576,"name":"EntityFramework","full_name":"laskoviymishka/EntityFramework","owner":{"login":"laskoviymishka","id":2754361,"avatar_url":"https://avatars.githubusercontent.com/u/2754361?v=3","gravatar_id":"","url":"https://api.github.com/users/laskoviymishka","html_url":"https://github.com/laskoviymishka","followers_url":"https://api.github.com/users/laskoviymishka/followers","following_url":"https://api.github.com/users/laskoviymishka/following{/other_user}","gists_url":"https://api.github.com/users/laskoviymishka/gists{/gist_id}","starred_url":"https://api.github.com/users/laskoviymishka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laskoviymishka/subscriptions","organizations_url":"https://api.github.com/users/laskoviymishka/orgs","repos_url":"https://api.github.com/users/laskoviymishka/repos","events_url":"https://api.github.com/users/laskoviymishka/events{/privacy}","received_events_url":"https://api.github.com/users/laskoviymishka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/laskoviymishka/EntityFramework","description":"Microsoft's recommended data access technology for new applications in .NET.","fork":true,"url":"https://api.github.com/repos/laskoviymishka/EntityFramework","forks_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/forks","keys_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/teams","hooks_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/hooks","issue_events_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/issues/events{/number}","events_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/events","assignees_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/assignees{/user}","branches_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/branches{/branch}","tags_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/tags","blobs_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/git/refs{/sha}","trees_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/statuses/{sha}","languages_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/languages","stargazers_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/stargazers","contributors_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/contributors","subscribers_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/subscribers","subscription_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/subscription","commits_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/commits{/sha}","git_commits_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/git/commits{/sha}","comments_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/comments{/number}","issue_comment_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/issues/comments{/number}","contents_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/contents/{+path}","compare_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/merges","archive_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/downloads","issues_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/issues{/number}","pulls_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/pulls{/number}","milestones_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/milestones{/number}","notifications_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/labels{/name}","releases_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/releases{/id}","deployments_url":"https://api.github.com/repos/laskoviymishka/EntityFramework/deployments","created_at":"2015-07-05T21:21:59Z","updated_at":"2016-03-11T10:04:07Z","pushed_at":"2016-03-23T15:11:26Z","git_url":"git://github.com/laskoviymishka/EntityFramework.git","ssh_url":"git@github.com:laskoviymishka/EntityFramework.git","clone_url":"https://github.com/laskoviymishka/EntityFramework.git","svn_url":"https://github.com/laskoviymishka/EntityFramework","homepage":"","size":31786,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"0e99f471fb9a70ab9b1b705fea8fccfa95019b80","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":16157746,"name":"EntityFramework","full_name":"aspnet/EntityFramework","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/EntityFramework","description":"Microsoft's recommended data access technology for new applications in .NET.","fork":false,"url":"https://api.github.com/repos/aspnet/EntityFramework","forks_url":"https://api.github.com/repos/aspnet/EntityFramework/forks","keys_url":"https://api.github.com/repos/aspnet/EntityFramework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/EntityFramework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/EntityFramework/teams","hooks_url":"https://api.github.com/repos/aspnet/EntityFramework/hooks","issue_events_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/EntityFramework/events","assignees_url":"https://api.github.com/repos/aspnet/EntityFramework/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/EntityFramework/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/EntityFramework/tags","blobs_url":"https://api.github.com/repos/aspnet/EntityFramework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/EntityFramework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/EntityFramework/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/EntityFramework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/EntityFramework/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/EntityFramework/languages","stargazers_url":"https://api.github.com/repos/aspnet/EntityFramework/stargazers","contributors_url":"https://api.github.com/repos/aspnet/EntityFramework/contributors","subscribers_url":"https://api.github.com/repos/aspnet/EntityFramework/subscribers","subscription_url":"https://api.github.com/repos/aspnet/EntityFramework/subscription","commits_url":"https://api.github.com/repos/aspnet/EntityFramework/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/EntityFramework/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/EntityFramework/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/EntityFramework/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/EntityFramework/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/EntityFramework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/EntityFramework/merges","archive_url":"https://api.github.com/repos/aspnet/EntityFramework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/EntityFramework/downloads","issues_url":"https://api.github.com/repos/aspnet/EntityFramework/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/EntityFramework/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/EntityFramework/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/EntityFramework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/EntityFramework/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/EntityFramework/releases{/id}","deployments_url":"https://api.github.com/repos/aspnet/EntityFramework/deployments","created_at":"2014-01-23T00:52:01Z","updated_at":"2016-03-24T19:07:39Z","pushed_at":"2016-03-24T19:21:36Z","git_url":"git://github.com/aspnet/EntityFramework.git","ssh_url":"git@github.com:aspnet/EntityFramework.git","clone_url":"https://github.com/aspnet/EntityFramework.git","svn_url":"https://github.com/aspnet/EntityFramework","homepage":"","size":47764,"stargazers_count":3021,"watchers_count":3021,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":923,"mirror_url":null,"open_issues_count":591,"forks":923,"open_issues":591,"watchers":3021,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661"},"html":{"href":"https://github.com/aspnet/EntityFramework/pull/4661"},"issue":{"href":"https://api.github.com/repos/aspnet/EntityFramework/issues/4661"},"comments":{"href":"https://api.github.com/repos/aspnet/EntityFramework/issues/4661/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/EntityFramework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/EntityFramework/pulls/4661/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/EntityFramework/statuses/ab3198ead0d254fbc72e9c77e02ec86b4a5a7853"}}}}