{"action":"created","issue":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2095","repository_url":"https://api.github.com/repos/phoenixframework/phoenix","labels_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2095/labels{/name}","comments_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2095/comments","events_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2095/events","html_url":"https://github.com/phoenixframework/phoenix/pull/2095","id":207661751,"number":2095,"title":"Fixing issue where the Repo is the incorrect module","user":{"login":"jeregrine","id":100886,"avatar_url":"https://avatars.githubusercontent.com/u/100886?v=3","gravatar_id":"","url":"https://api.github.com/users/jeregrine","html_url":"https://github.com/jeregrine","followers_url":"https://api.github.com/users/jeregrine/followers","following_url":"https://api.github.com/users/jeregrine/following{/other_user}","gists_url":"https://api.github.com/users/jeregrine/gists{/gist_id}","starred_url":"https://api.github.com/users/jeregrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeregrine/subscriptions","organizations_url":"https://api.github.com/users/jeregrine/orgs","repos_url":"https://api.github.com/users/jeregrine/repos","events_url":"https://api.github.com/users/jeregrine/events{/privacy}","received_events_url":"https://api.github.com/users/jeregrine/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-14T22:58:12Z","updated_at":"2017-02-22T00:57:13Z","closed_at":"2017-02-22T00:57:13Z","pull_request":{"url":"https://api.github.com/repos/phoenixframework/phoenix/pulls/2095","html_url":"https://github.com/phoenixframework/phoenix/pull/2095","diff_url":"https://github.com/phoenixframework/phoenix/pull/2095.diff","patch_url":"https://github.com/phoenixframework/phoenix/pull/2095.patch"},"body":"It was generating a new schema with the following alias:\r\n```elixir\r\nalias App.Web.Repo\r\n```\r\n\r\nWhich is incorrect in the case of an umbrella application. So I'm not sure this is the correct fix but if you use phx.gen it will set the repo to override the default. \r\n"},"comment":{"url":"https://api.github.com/repos/phoenixframework/phoenix/issues/comments/281533001","html_url":"https://github.com/phoenixframework/phoenix/pull/2095#issuecomment-281533001","issue_url":"https://api.github.com/repos/phoenixframework/phoenix/issues/2095","id":281533001,"user":{"login":"chrismccord","id":576796,"avatar_url":"https://avatars.githubusercontent.com/u/576796?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismccord","html_url":"https://github.com/chrismccord","followers_url":"https://api.github.com/users/chrismccord/followers","following_url":"https://api.github.com/users/chrismccord/following{/other_user}","gists_url":"https://api.github.com/users/chrismccord/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismccord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismccord/subscriptions","organizations_url":"https://api.github.com/users/chrismccord/orgs","repos_url":"https://api.github.com/users/chrismccord/repos","events_url":"https://api.github.com/users/chrismccord/events{/privacy}","received_events_url":"https://api.github.com/users/chrismccord/received_events","type":"User","site_admin":false},"created_at":"2017-02-22T00:57:13Z","updated_at":"2017-02-22T00:57:13Z","body":"Can you sure how you are are running the command? For example, inside which umbrella app? The issue is wifi you run `$ mix phx.gen.schema ..`. inside a non-phoenix app, then the task won't be found unless you are depending on phoenix itself for that app. In the case you are inside your phoenix web project, then it will use the namespace of whatever the application uses, in which case MyApp.Web.Repo would be \"correct\". I think the correct solution is to only use `phx.gen.schema` in the context of a web project which depends on phoenix, and when outside of that, you can call ecto's generators directly, such as `ecto.gen.migration|repo`. Perhaps ecto needs a gen.schema command? Thanks for the PR. Closing, but feel free to follow up if I'm not making sense. <3 <3 <3"}}
{"actor":{"display_login":"chrismccord"}}