{"action":"created","comment":{"url":"https://api.github.com/repos/DbUp/DbUp/pulls/comments/39484033","id":39484033,"diff_hunk":"@@ -56,24 +131,65 @@ public FileSystemScriptProvider(string directoryPath, Encoding encoding)\n         ///<param name=\"encoding\">The encoding.</param>\n         public FileSystemScriptProvider(string directoryPath, Func<string, bool> filter, Encoding encoding)\n         {\n-            this.directoryPath = directoryPath;\n-            this.filter = filter;\n-            this.encoding = encoding;\n+            DirectoryPath = directoryPath;\n+            Filter = filter;\n+            Encoding = encoding;\n+            Recursive = false;\n+        }\n+\n+        /// <summary>\n+        /// </summary>\n+        /// <param name=\"directoryPath\">Path to SQL upgrade scripts</param>\n+        /// <param name=\"filter\">The filter.</param>\n+        /// <param name=\"encoding\">The encoding.</param>\n+        /// <param name=\"recursive\">Include sub-folders?</param>\n+        public FileSystemScriptProvider(string directoryPath, Func<string, bool> filter, Encoding encoding, bool recursive)\n+        {\n+            DirectoryPath = directoryPath;\n+            Filter = filter;\n+            Encoding = encoding;\n+            Recursive = recursive;\n         }\n \n         /// <summary>\n         /// Gets all scripts that should be executed.\n         /// </summary>\n+        [SuppressMessage(\"ReSharper\", \"PossibleNullReferenceException\")]\n         public IEnumerable<SqlScript> GetScripts(IConnectionManager connectionManager)\n         {\n-            var files = Directory.GetFiles(directoryPath, \"*.sql\").AsEnumerable();\n-            if (this.filter != null)\n+            if (string.IsNullOrEmpty(DirectoryPath.Trim()))\n             {\n-                files = files.Where(filter);\n+                DirectoryPath = Environment.CurrentDirectory;\n             }\n-            return files.Select(x => SqlScript.FromFile(x, encoding)).ToList();\n-        }\n-\n \n+            //  Notes:  \n+            //      1.  When Directory.Getfiles() is passed an extension that is EXACTLY 3 characters in length, the \n+            //          resulting file list will contain any file with an extension longer than 4 characters that\n+            //          begins with the specified extension. This is a documented FEATURE. \n+            //      2.  In order to limit the returned file list to just those with the extension \".sql\" (nothing \n+            //          more and nothing less, it is necessary to add a .Where condition that filters on the \n+            //          extension.\n+            //      Why do both? To limit the list returned by Directory.Getfiles() in case there are lots of other\n+            //      files in the specified DirectoryPath...\n+            return Directory","path":"src/DbUp/ScriptProviders/FileSystemScriptProvider.cs","position":185,"original_position":185,"commit_id":"d01cfe8a50bbd2b84e4959aa8180603ccf0a8531","original_commit_id":"d01cfe8a50bbd2b84e4959aa8180603ccf0a8531","user":{"login":"rickculpepper","id":4801808,"avatar_url":"https://avatars.githubusercontent.com/u/4801808?v=3","gravatar_id":"","url":"https://api.github.com/users/rickculpepper","html_url":"https://github.com/rickculpepper","followers_url":"https://api.github.com/users/rickculpepper/followers","following_url":"https://api.github.com/users/rickculpepper/following{/other_user}","gists_url":"https://api.github.com/users/rickculpepper/gists{/gist_id}","starred_url":"https://api.github.com/users/rickculpepper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickculpepper/subscriptions","organizations_url":"https://api.github.com/users/rickculpepper/orgs","repos_url":"https://api.github.com/users/rickculpepper/repos","events_url":"https://api.github.com/users/rickculpepper/events{/privacy}","received_events_url":"https://api.github.com/users/rickculpepper/received_events","type":"User","site_admin":false},"body":"@dazinator, we're on the same page here... ;)\r\n\r\n@JakeGinnivan, Yes. This is a breaking change, but only for databases that have been previously upgraded `.WithScriptsFromFileSystem`","created_at":"2015-09-15T08:06:23Z","updated_at":"2015-09-15T08:06:23Z","html_url":"https://github.com/DbUp/DbUp/pull/129#discussion_r39484033","pull_request_url":"https://api.github.com/repos/DbUp/DbUp/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/DbUp/DbUp/pulls/comments/39484033"},"html":{"href":"https://github.com/DbUp/DbUp/pull/129#discussion_r39484033"},"pull_request":{"href":"https://api.github.com/repos/DbUp/DbUp/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/DbUp/DbUp/pulls/129","id":44917119,"html_url":"https://github.com/DbUp/DbUp/pull/129","diff_url":"https://github.com/DbUp/DbUp/pull/129.diff","patch_url":"https://github.com/DbUp/DbUp/pull/129.patch","issue_url":"https://api.github.com/repos/DbUp/DbUp/issues/129","number":129,"state":"open","locked":false,"title":"SQLCMD Support and File Folder Recursion for Scripts","user":{"login":"rickculpepper","id":4801808,"avatar_url":"https://avatars.githubusercontent.com/u/4801808?v=3","gravatar_id":"","url":"https://api.github.com/users/rickculpepper","html_url":"https://github.com/rickculpepper","followers_url":"https://api.github.com/users/rickculpepper/followers","following_url":"https://api.github.com/users/rickculpepper/following{/other_user}","gists_url":"https://api.github.com/users/rickculpepper/gists{/gist_id}","starred_url":"https://api.github.com/users/rickculpepper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickculpepper/subscriptions","organizations_url":"https://api.github.com/users/rickculpepper/orgs","repos_url":"https://api.github.com/users/rickculpepper/repos","events_url":"https://api.github.com/users/rickculpepper/events{/privacy}","received_events_url":"https://api.github.com/users/rickculpepper/received_events","type":"User","site_admin":false},"body":"This pull request addresses both of the following Issues. The pull includes new unit tests to very and a new sample application to demonstrate the functionality.\r\n\r\n#123 SQLCMD Script Support\r\n#124 FileSystemScriptProvider Support for Folder Recursion","created_at":"2015-09-14T11:02:39Z","updated_at":"2015-09-15T08:06:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14a1d0473d7dbf39fe0dc9967760b56ddd718234","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DbUp/DbUp/pulls/129/commits","review_comments_url":"https://api.github.com/repos/DbUp/DbUp/pulls/129/comments","review_comment_url":"https://api.github.com/repos/DbUp/DbUp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DbUp/DbUp/issues/129/comments","statuses_url":"https://api.github.com/repos/DbUp/DbUp/statuses/d01cfe8a50bbd2b84e4959aa8180603ccf0a8531","head":{"label":"rickculpepper:SqlCmdSupportAndFileFolderRecursion","ref":"SqlCmdSupportAndFileFolderRecursion","sha":"d01cfe8a50bbd2b84e4959aa8180603ccf0a8531","user":{"login":"rickculpepper","id":4801808,"avatar_url":"https://avatars.githubusercontent.com/u/4801808?v=3","gravatar_id":"","url":"https://api.github.com/users/rickculpepper","html_url":"https://github.com/rickculpepper","followers_url":"https://api.github.com/users/rickculpepper/followers","following_url":"https://api.github.com/users/rickculpepper/following{/other_user}","gists_url":"https://api.github.com/users/rickculpepper/gists{/gist_id}","starred_url":"https://api.github.com/users/rickculpepper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickculpepper/subscriptions","organizations_url":"https://api.github.com/users/rickculpepper/orgs","repos_url":"https://api.github.com/users/rickculpepper/repos","events_url":"https://api.github.com/users/rickculpepper/events{/privacy}","received_events_url":"https://api.github.com/users/rickculpepper/received_events","type":"User","site_admin":false},"repo":{"id":41122122,"name":"DbUp","full_name":"rickculpepper/DbUp","owner":{"login":"rickculpepper","id":4801808,"avatar_url":"https://avatars.githubusercontent.com/u/4801808?v=3","gravatar_id":"","url":"https://api.github.com/users/rickculpepper","html_url":"https://github.com/rickculpepper","followers_url":"https://api.github.com/users/rickculpepper/followers","following_url":"https://api.github.com/users/rickculpepper/following{/other_user}","gists_url":"https://api.github.com/users/rickculpepper/gists{/gist_id}","starred_url":"https://api.github.com/users/rickculpepper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickculpepper/subscriptions","organizations_url":"https://api.github.com/users/rickculpepper/orgs","repos_url":"https://api.github.com/users/rickculpepper/repos","events_url":"https://api.github.com/users/rickculpepper/events{/privacy}","received_events_url":"https://api.github.com/users/rickculpepper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rickculpepper/DbUp","description":"DbUp is a .NET library that helps you to deploy changes to SQL Server databases. It tracks which SQL scripts have been run already, and runs the change scripts that are needed to get your database up to date.  ","fork":true,"url":"https://api.github.com/repos/rickculpepper/DbUp","forks_url":"https://api.github.com/repos/rickculpepper/DbUp/forks","keys_url":"https://api.github.com/repos/rickculpepper/DbUp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rickculpepper/DbUp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rickculpepper/DbUp/teams","hooks_url":"https://api.github.com/repos/rickculpepper/DbUp/hooks","issue_events_url":"https://api.github.com/repos/rickculpepper/DbUp/issues/events{/number}","events_url":"https://api.github.com/repos/rickculpepper/DbUp/events","assignees_url":"https://api.github.com/repos/rickculpepper/DbUp/assignees{/user}","branches_url":"https://api.github.com/repos/rickculpepper/DbUp/branches{/branch}","tags_url":"https://api.github.com/repos/rickculpepper/DbUp/tags","blobs_url":"https://api.github.com/repos/rickculpepper/DbUp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rickculpepper/DbUp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rickculpepper/DbUp/git/refs{/sha}","trees_url":"https://api.github.com/repos/rickculpepper/DbUp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rickculpepper/DbUp/statuses/{sha}","languages_url":"https://api.github.com/repos/rickculpepper/DbUp/languages","stargazers_url":"https://api.github.com/repos/rickculpepper/DbUp/stargazers","contributors_url":"https://api.github.com/repos/rickculpepper/DbUp/contributors","subscribers_url":"https://api.github.com/repos/rickculpepper/DbUp/subscribers","subscription_url":"https://api.github.com/repos/rickculpepper/DbUp/subscription","commits_url":"https://api.github.com/repos/rickculpepper/DbUp/commits{/sha}","git_commits_url":"https://api.github.com/repos/rickculpepper/DbUp/git/commits{/sha}","comments_url":"https://api.github.com/repos/rickculpepper/DbUp/comments{/number}","issue_comment_url":"https://api.github.com/repos/rickculpepper/DbUp/issues/comments{/number}","contents_url":"https://api.github.com/repos/rickculpepper/DbUp/contents/{+path}","compare_url":"https://api.github.com/repos/rickculpepper/DbUp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rickculpepper/DbUp/merges","archive_url":"https://api.github.com/repos/rickculpepper/DbUp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rickculpepper/DbUp/downloads","issues_url":"https://api.github.com/repos/rickculpepper/DbUp/issues{/number}","pulls_url":"https://api.github.com/repos/rickculpepper/DbUp/pulls{/number}","milestones_url":"https://api.github.com/repos/rickculpepper/DbUp/milestones{/number}","notifications_url":"https://api.github.com/repos/rickculpepper/DbUp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rickculpepper/DbUp/labels{/name}","releases_url":"https://api.github.com/repos/rickculpepper/DbUp/releases{/id}","created_at":"2015-08-20T22:41:25Z","updated_at":"2015-08-22T15:40:15Z","pushed_at":"2015-09-14T12:49:36Z","git_url":"git://github.com/rickculpepper/DbUp.git","ssh_url":"git@github.com:rickculpepper/DbUp.git","clone_url":"https://github.com/rickculpepper/DbUp.git","svn_url":"https://github.com/rickculpepper/DbUp","homepage":"http://dbup.github.io","size":30007,"stargazers_count":1,"watchers_count":1,"language":"C#","has_issues":false,"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":1,"default_branch":"master"}},"base":{"label":"DbUp:master","ref":"master","sha":"1fea3f1d9ef9f7709a916e91e17089da1d71a9d3","user":{"login":"DbUp","id":1959007,"avatar_url":"https://avatars.githubusercontent.com/u/1959007?v=3","gravatar_id":"","url":"https://api.github.com/users/DbUp","html_url":"https://github.com/DbUp","followers_url":"https://api.github.com/users/DbUp/followers","following_url":"https://api.github.com/users/DbUp/following{/other_user}","gists_url":"https://api.github.com/users/DbUp/gists{/gist_id}","starred_url":"https://api.github.com/users/DbUp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DbUp/subscriptions","organizations_url":"https://api.github.com/users/DbUp/orgs","repos_url":"https://api.github.com/users/DbUp/repos","events_url":"https://api.github.com/users/DbUp/events{/privacy}","received_events_url":"https://api.github.com/users/DbUp/received_events","type":"Organization","site_admin":false},"repo":{"id":4995017,"name":"DbUp","full_name":"DbUp/DbUp","owner":{"login":"DbUp","id":1959007,"avatar_url":"https://avatars.githubusercontent.com/u/1959007?v=3","gravatar_id":"","url":"https://api.github.com/users/DbUp","html_url":"https://github.com/DbUp","followers_url":"https://api.github.com/users/DbUp/followers","following_url":"https://api.github.com/users/DbUp/following{/other_user}","gists_url":"https://api.github.com/users/DbUp/gists{/gist_id}","starred_url":"https://api.github.com/users/DbUp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DbUp/subscriptions","organizations_url":"https://api.github.com/users/DbUp/orgs","repos_url":"https://api.github.com/users/DbUp/repos","events_url":"https://api.github.com/users/DbUp/events{/privacy}","received_events_url":"https://api.github.com/users/DbUp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DbUp/DbUp","description":"DbUp is a .NET library that helps you to deploy changes to SQL Server databases. It tracks which SQL scripts have been run already, and runs the change scripts that are needed to get your database up to date.  ","fork":false,"url":"https://api.github.com/repos/DbUp/DbUp","forks_url":"https://api.github.com/repos/DbUp/DbUp/forks","keys_url":"https://api.github.com/repos/DbUp/DbUp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DbUp/DbUp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DbUp/DbUp/teams","hooks_url":"https://api.github.com/repos/DbUp/DbUp/hooks","issue_events_url":"https://api.github.com/repos/DbUp/DbUp/issues/events{/number}","events_url":"https://api.github.com/repos/DbUp/DbUp/events","assignees_url":"https://api.github.com/repos/DbUp/DbUp/assignees{/user}","branches_url":"https://api.github.com/repos/DbUp/DbUp/branches{/branch}","tags_url":"https://api.github.com/repos/DbUp/DbUp/tags","blobs_url":"https://api.github.com/repos/DbUp/DbUp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DbUp/DbUp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DbUp/DbUp/git/refs{/sha}","trees_url":"https://api.github.com/repos/DbUp/DbUp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DbUp/DbUp/statuses/{sha}","languages_url":"https://api.github.com/repos/DbUp/DbUp/languages","stargazers_url":"https://api.github.com/repos/DbUp/DbUp/stargazers","contributors_url":"https://api.github.com/repos/DbUp/DbUp/contributors","subscribers_url":"https://api.github.com/repos/DbUp/DbUp/subscribers","subscription_url":"https://api.github.com/repos/DbUp/DbUp/subscription","commits_url":"https://api.github.com/repos/DbUp/DbUp/commits{/sha}","git_commits_url":"https://api.github.com/repos/DbUp/DbUp/git/commits{/sha}","comments_url":"https://api.github.com/repos/DbUp/DbUp/comments{/number}","issue_comment_url":"https://api.github.com/repos/DbUp/DbUp/issues/comments{/number}","contents_url":"https://api.github.com/repos/DbUp/DbUp/contents/{+path}","compare_url":"https://api.github.com/repos/DbUp/DbUp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DbUp/DbUp/merges","archive_url":"https://api.github.com/repos/DbUp/DbUp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DbUp/DbUp/downloads","issues_url":"https://api.github.com/repos/DbUp/DbUp/issues{/number}","pulls_url":"https://api.github.com/repos/DbUp/DbUp/pulls{/number}","milestones_url":"https://api.github.com/repos/DbUp/DbUp/milestones{/number}","notifications_url":"https://api.github.com/repos/DbUp/DbUp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DbUp/DbUp/labels{/name}","releases_url":"https://api.github.com/repos/DbUp/DbUp/releases{/id}","created_at":"2012-07-11T20:59:02Z","updated_at":"2015-09-10T18:56:30Z","pushed_at":"2015-09-14T11:02:40Z","git_url":"git://github.com/DbUp/DbUp.git","ssh_url":"git@github.com:DbUp/DbUp.git","clone_url":"https://github.com/DbUp/DbUp.git","svn_url":"https://github.com/DbUp/DbUp","homepage":"http://dbup.github.io","size":36578,"stargazers_count":211,"watchers_count":211,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":110,"mirror_url":null,"open_issues_count":19,"forks":110,"open_issues":19,"watchers":211,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DbUp/DbUp/pulls/129"},"html":{"href":"https://github.com/DbUp/DbUp/pull/129"},"issue":{"href":"https://api.github.com/repos/DbUp/DbUp/issues/129"},"comments":{"href":"https://api.github.com/repos/DbUp/DbUp/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/DbUp/DbUp/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/DbUp/DbUp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DbUp/DbUp/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/DbUp/DbUp/statuses/d01cfe8a50bbd2b84e4959aa8180603ccf0a8531"}}}}