{"action":"created","issue":{"url":"https://api.github.com/repos/ikkez/f3-schema-builder/issues/5","repository_url":"https://api.github.com/repos/ikkez/f3-schema-builder","labels_url":"https://api.github.com/repos/ikkez/f3-schema-builder/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/ikkez/f3-schema-builder/issues/5/comments","events_url":"https://api.github.com/repos/ikkez/f3-schema-builder/issues/5/events","html_url":"https://github.com/ikkez/f3-schema-builder/issues/5","id":279528586,"number":5,"title":"View support","user":{"login":"Pilskalns","id":6931156,"avatar_url":"https://avatars2.githubusercontent.com/u/6931156?v=4","gravatar_id":"","url":"https://api.github.com/users/Pilskalns","html_url":"https://github.com/Pilskalns","followers_url":"https://api.github.com/users/Pilskalns/followers","following_url":"https://api.github.com/users/Pilskalns/following{/other_user}","gists_url":"https://api.github.com/users/Pilskalns/gists{/gist_id}","starred_url":"https://api.github.com/users/Pilskalns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pilskalns/subscriptions","organizations_url":"https://api.github.com/users/Pilskalns/orgs","repos_url":"https://api.github.com/users/Pilskalns/repos","events_url":"https://api.github.com/users/Pilskalns/events{/privacy}","received_events_url":"https://api.github.com/users/Pilskalns/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-05T20:59:47Z","updated_at":"2017-12-06T17:11:44Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nAre you considering adding support for views? 😃 "},"comment":{"url":"https://api.github.com/repos/ikkez/f3-schema-builder/issues/comments/349708684","html_url":"https://github.com/ikkez/f3-schema-builder/issues/5#issuecomment-349708684","issue_url":"https://api.github.com/repos/ikkez/f3-schema-builder/issues/5","id":349708684,"user":{"login":"Pilskalns","id":6931156,"avatar_url":"https://avatars2.githubusercontent.com/u/6931156?v=4","gravatar_id":"","url":"https://api.github.com/users/Pilskalns","html_url":"https://github.com/Pilskalns","followers_url":"https://api.github.com/users/Pilskalns/followers","following_url":"https://api.github.com/users/Pilskalns/following{/other_user}","gists_url":"https://api.github.com/users/Pilskalns/gists{/gist_id}","starred_url":"https://api.github.com/users/Pilskalns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pilskalns/subscriptions","organizations_url":"https://api.github.com/users/Pilskalns/orgs","repos_url":"https://api.github.com/users/Pilskalns/repos","events_url":"https://api.github.com/users/Pilskalns/events{/privacy}","received_events_url":"https://api.github.com/users/Pilskalns/received_events","type":"User","site_admin":false},"created_at":"2017-12-06T17:11:44Z","updated_at":"2017-12-06T17:11:44Z","author_association":"NONE","body":"Yeah... SQL syntax can be *itchy, especially to compliment different environments and limitations... This is why I turned to this plugin to implement incremental DB versioning upgrades for internal statistics tool I maintain.\r\n\r\nAnd in this case I use view to join two tables. Let's assume we have table_users (id, name, orgid) and table_orgs (orgid, name) and quite simple, but important view I use is to add org name to users.\r\n\r\n```sql\r\nCREATE OR REPLACE VIEW `view_users` AS\r\nSELECT users.*,orgs.name AS orgname\r\nFROM users\r\nLEFT JOIN orgs ON users.orgid = orgs.orgid\r\nORDER BY orgname DESC;\r\n```\r\n\r\nHad to use AS, because initially used same column names between tables... At that point I didn't know anything about SQL Views and thought will be joining this info in app code. Local SQLite was happy about that, but deployed on *prod* MySQL broke off everything...\r\n\r\nSo this is my use case:\r\n1. Take two tables\r\n2. Add aliases for columns with same names\r\n3. Join on where ID columns matches\r\n4. Append with ordering"}}
{"actor":{"display_login":"Pilskalns"}}