{"action":"opened","number":582,"pull_request":{"url":"https://api.github.com/repos/schambers/fluentmigrator/pulls/582","id":29763126,"html_url":"https://github.com/schambers/fluentmigrator/pull/582","diff_url":"https://github.com/schambers/fluentmigrator/pull/582.diff","patch_url":"https://github.com/schambers/fluentmigrator/pull/582.patch","issue_url":"https://api.github.com/repos/schambers/fluentmigrator/issues/582","number":582,"state":"open","locked":false,"title":"Allows to specify custom version table meta data","user":{"login":"istaheev","id":135631,"avatar_url":"https://avatars.githubusercontent.com/u/135631?v=3","gravatar_id":"","url":"https://api.github.com/users/istaheev","html_url":"https://github.com/istaheev","followers_url":"https://api.github.com/users/istaheev/followers","following_url":"https://api.github.com/users/istaheev/following{/other_user}","gists_url":"https://api.github.com/users/istaheev/gists{/gist_id}","starred_url":"https://api.github.com/users/istaheev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istaheev/subscriptions","organizations_url":"https://api.github.com/users/istaheev/orgs","repos_url":"https://api.github.com/users/istaheev/repos","events_url":"https://api.github.com/users/istaheev/events{/privacy}","received_events_url":"https://api.github.com/users/istaheev/received_events","type":"User","site_admin":false},"body":"Introduction\r\n------------\r\nI have a PostgreSQL database with many independent schemas where all schemas have similar database structure and new schemas can be created on the fly.\r\nSince I am already using FluentMigrator in the project and have excellent experience with it I tried to use it to populate schemas but, unfortunately, it failed.\r\n\r\nThe problem and solution\r\n-----------\r\nIn this scenario every schema can be interpreted as an independent database. Each schema should have its own `VersionInfo` table, so I can run FluentMigrator for every schema and get expected result. For PostgreSQL this can be achieved very easily by setting SearchPath in the connection string (\"...;SearchPath=schema1\") and all migrations should now be applied to this schema only (and `VersionInfo` table will be created there too).\r\nUnfortunately the PostgreSQL backend has strange behavior to use \"public\" as the default replacement for unspecified schema names, it makes this scenario impossible.\r\n\r\nI can solve this on the migrations level by setting `ApplicationContext` to a schema name and using it everywhere where a schema name is expected, e.g. `Create.Table(\"test\").InSchema((string)ApplicationContext)`. But there is no workaround for `VersionInfo` table, one can specify only static name for it via an object implementing `IVersionTableMetaData` interface which can only be instantiated from the assembly.\r\n\r\nThis patch allows to specify custom `IVersionTableMetaData` object via `IRunnerContext`. If the custom object is not set then old behavior is used (search for a class in the assembly).\r\n","created_at":"2015-02-22T00:34:08Z","updated_at":"2015-02-22T00:34:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ecf04608adaea42f9c42de0688345e059cdb8108","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/schambers/fluentmigrator/pulls/582/commits","review_comments_url":"https://api.github.com/repos/schambers/fluentmigrator/pulls/582/comments","review_comment_url":"https://api.github.com/repos/schambers/fluentmigrator/pulls/comments/{number}","comments_url":"https://api.github.com/repos/schambers/fluentmigrator/issues/582/comments","statuses_url":"https://api.github.com/repos/schambers/fluentmigrator/statuses/439d50ca78d8c1d5be7d90aa534f72ab1184321a","head":{"label":"istaheev:allow-per-schema-migrations","ref":"allow-per-schema-migrations","sha":"439d50ca78d8c1d5be7d90aa534f72ab1184321a","user":{"login":"istaheev","id":135631,"avatar_url":"https://avatars.githubusercontent.com/u/135631?v=3","gravatar_id":"","url":"https://api.github.com/users/istaheev","html_url":"https://github.com/istaheev","followers_url":"https://api.github.com/users/istaheev/followers","following_url":"https://api.github.com/users/istaheev/following{/other_user}","gists_url":"https://api.github.com/users/istaheev/gists{/gist_id}","starred_url":"https://api.github.com/users/istaheev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istaheev/subscriptions","organizations_url":"https://api.github.com/users/istaheev/orgs","repos_url":"https://api.github.com/users/istaheev/repos","events_url":"https://api.github.com/users/istaheev/events{/privacy}","received_events_url":"https://api.github.com/users/istaheev/received_events","type":"User","site_admin":false},"repo":{"id":31143384,"name":"fluentmigrator","full_name":"istaheev/fluentmigrator","owner":{"login":"istaheev","id":135631,"avatar_url":"https://avatars.githubusercontent.com/u/135631?v=3","gravatar_id":"","url":"https://api.github.com/users/istaheev","html_url":"https://github.com/istaheev","followers_url":"https://api.github.com/users/istaheev/followers","following_url":"https://api.github.com/users/istaheev/following{/other_user}","gists_url":"https://api.github.com/users/istaheev/gists{/gist_id}","starred_url":"https://api.github.com/users/istaheev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istaheev/subscriptions","organizations_url":"https://api.github.com/users/istaheev/orgs","repos_url":"https://api.github.com/users/istaheev/repos","events_url":"https://api.github.com/users/istaheev/events{/privacy}","received_events_url":"https://api.github.com/users/istaheev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/istaheev/fluentmigrator","description":"Fluent Migrations framework for .net","fork":true,"url":"https://api.github.com/repos/istaheev/fluentmigrator","forks_url":"https://api.github.com/repos/istaheev/fluentmigrator/forks","keys_url":"https://api.github.com/repos/istaheev/fluentmigrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istaheev/fluentmigrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istaheev/fluentmigrator/teams","hooks_url":"https://api.github.com/repos/istaheev/fluentmigrator/hooks","issue_events_url":"https://api.github.com/repos/istaheev/fluentmigrator/issues/events{/number}","events_url":"https://api.github.com/repos/istaheev/fluentmigrator/events","assignees_url":"https://api.github.com/repos/istaheev/fluentmigrator/assignees{/user}","branches_url":"https://api.github.com/repos/istaheev/fluentmigrator/branches{/branch}","tags_url":"https://api.github.com/repos/istaheev/fluentmigrator/tags","blobs_url":"https://api.github.com/repos/istaheev/fluentmigrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istaheev/fluentmigrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istaheev/fluentmigrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/istaheev/fluentmigrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istaheev/fluentmigrator/statuses/{sha}","languages_url":"https://api.github.com/repos/istaheev/fluentmigrator/languages","stargazers_url":"https://api.github.com/repos/istaheev/fluentmigrator/stargazers","contributors_url":"https://api.github.com/repos/istaheev/fluentmigrator/contributors","subscribers_url":"https://api.github.com/repos/istaheev/fluentmigrator/subscribers","subscription_url":"https://api.github.com/repos/istaheev/fluentmigrator/subscription","commits_url":"https://api.github.com/repos/istaheev/fluentmigrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/istaheev/fluentmigrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/istaheev/fluentmigrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/istaheev/fluentmigrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/istaheev/fluentmigrator/contents/{+path}","compare_url":"https://api.github.com/repos/istaheev/fluentmigrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istaheev/fluentmigrator/merges","archive_url":"https://api.github.com/repos/istaheev/fluentmigrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istaheev/fluentmigrator/downloads","issues_url":"https://api.github.com/repos/istaheev/fluentmigrator/issues{/number}","pulls_url":"https://api.github.com/repos/istaheev/fluentmigrator/pulls{/number}","milestones_url":"https://api.github.com/repos/istaheev/fluentmigrator/milestones{/number}","notifications_url":"https://api.github.com/repos/istaheev/fluentmigrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istaheev/fluentmigrator/labels{/name}","releases_url":"https://api.github.com/repos/istaheev/fluentmigrator/releases{/id}","created_at":"2015-02-21T22:20:56Z","updated_at":"2015-02-21T22:20:58Z","pushed_at":"2015-02-21T23:54:03Z","git_url":"git://github.com/istaheev/fluentmigrator.git","ssh_url":"git@github.com:istaheev/fluentmigrator.git","clone_url":"https://github.com/istaheev/fluentmigrator.git","svn_url":"https://github.com/istaheev/fluentmigrator","homepage":"http://www.github.com/schambers/fluentmigrator","size":85941,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"schambers:master","ref":"master","sha":"ce134fb4d2a72cc61aab9bb9f317b63496ad8e12","user":{"login":"schambers","id":31563,"avatar_url":"https://avatars.githubusercontent.com/u/31563?v=3","gravatar_id":"","url":"https://api.github.com/users/schambers","html_url":"https://github.com/schambers","followers_url":"https://api.github.com/users/schambers/followers","following_url":"https://api.github.com/users/schambers/following{/other_user}","gists_url":"https://api.github.com/users/schambers/gists{/gist_id}","starred_url":"https://api.github.com/users/schambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schambers/subscriptions","organizations_url":"https://api.github.com/users/schambers/orgs","repos_url":"https://api.github.com/users/schambers/repos","events_url":"https://api.github.com/users/schambers/events{/privacy}","received_events_url":"https://api.github.com/users/schambers/received_events","type":"User","site_admin":false},"repo":{"id":589349,"name":"fluentmigrator","full_name":"schambers/fluentmigrator","owner":{"login":"schambers","id":31563,"avatar_url":"https://avatars.githubusercontent.com/u/31563?v=3","gravatar_id":"","url":"https://api.github.com/users/schambers","html_url":"https://github.com/schambers","followers_url":"https://api.github.com/users/schambers/followers","following_url":"https://api.github.com/users/schambers/following{/other_user}","gists_url":"https://api.github.com/users/schambers/gists{/gist_id}","starred_url":"https://api.github.com/users/schambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schambers/subscriptions","organizations_url":"https://api.github.com/users/schambers/orgs","repos_url":"https://api.github.com/users/schambers/repos","events_url":"https://api.github.com/users/schambers/events{/privacy}","received_events_url":"https://api.github.com/users/schambers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/schambers/fluentmigrator","description":"Fluent Migrations framework for .net","fork":false,"url":"https://api.github.com/repos/schambers/fluentmigrator","forks_url":"https://api.github.com/repos/schambers/fluentmigrator/forks","keys_url":"https://api.github.com/repos/schambers/fluentmigrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schambers/fluentmigrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schambers/fluentmigrator/teams","hooks_url":"https://api.github.com/repos/schambers/fluentmigrator/hooks","issue_events_url":"https://api.github.com/repos/schambers/fluentmigrator/issues/events{/number}","events_url":"https://api.github.com/repos/schambers/fluentmigrator/events","assignees_url":"https://api.github.com/repos/schambers/fluentmigrator/assignees{/user}","branches_url":"https://api.github.com/repos/schambers/fluentmigrator/branches{/branch}","tags_url":"https://api.github.com/repos/schambers/fluentmigrator/tags","blobs_url":"https://api.github.com/repos/schambers/fluentmigrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schambers/fluentmigrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schambers/fluentmigrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/schambers/fluentmigrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schambers/fluentmigrator/statuses/{sha}","languages_url":"https://api.github.com/repos/schambers/fluentmigrator/languages","stargazers_url":"https://api.github.com/repos/schambers/fluentmigrator/stargazers","contributors_url":"https://api.github.com/repos/schambers/fluentmigrator/contributors","subscribers_url":"https://api.github.com/repos/schambers/fluentmigrator/subscribers","subscription_url":"https://api.github.com/repos/schambers/fluentmigrator/subscription","commits_url":"https://api.github.com/repos/schambers/fluentmigrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/schambers/fluentmigrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/schambers/fluentmigrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/schambers/fluentmigrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/schambers/fluentmigrator/contents/{+path}","compare_url":"https://api.github.com/repos/schambers/fluentmigrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schambers/fluentmigrator/merges","archive_url":"https://api.github.com/repos/schambers/fluentmigrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schambers/fluentmigrator/downloads","issues_url":"https://api.github.com/repos/schambers/fluentmigrator/issues{/number}","pulls_url":"https://api.github.com/repos/schambers/fluentmigrator/pulls{/number}","milestones_url":"https://api.github.com/repos/schambers/fluentmigrator/milestones{/number}","notifications_url":"https://api.github.com/repos/schambers/fluentmigrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schambers/fluentmigrator/labels{/name}","releases_url":"https://api.github.com/repos/schambers/fluentmigrator/releases{/id}","created_at":"2010-04-01T01:00:55Z","updated_at":"2015-02-21T08:31:00Z","pushed_at":"2015-02-18T19:57:02Z","git_url":"git://github.com/schambers/fluentmigrator.git","ssh_url":"git@github.com:schambers/fluentmigrator.git","clone_url":"https://github.com/schambers/fluentmigrator.git","svn_url":"https://github.com/schambers/fluentmigrator","homepage":"http://www.github.com/schambers/fluentmigrator","size":85941,"stargazers_count":833,"watchers_count":833,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":65,"forks":340,"open_issues":65,"watchers":833,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/schambers/fluentmigrator/pulls/582"},"html":{"href":"https://github.com/schambers/fluentmigrator/pull/582"},"issue":{"href":"https://api.github.com/repos/schambers/fluentmigrator/issues/582"},"comments":{"href":"https://api.github.com/repos/schambers/fluentmigrator/issues/582/comments"},"review_comments":{"href":"https://api.github.com/repos/schambers/fluentmigrator/pulls/582/comments"},"review_comment":{"href":"https://api.github.com/repos/schambers/fluentmigrator/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/schambers/fluentmigrator/pulls/582/commits"},"statuses":{"href":"https://api.github.com/repos/schambers/fluentmigrator/statuses/439d50ca78d8c1d5be7d90aa534f72ab1184321a"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":34,"deletions":1,"changed_files":5}}