{"action":"created","issue":{"url":"https://api.github.com/repos/redaxo/redaxo/issues/452","labels_url":"https://api.github.com/repos/redaxo/redaxo/issues/452/labels{/name}","comments_url":"https://api.github.com/repos/redaxo/redaxo/issues/452/comments","events_url":"https://api.github.com/repos/redaxo/redaxo/issues/452/events","html_url":"https://github.com/redaxo/redaxo/pull/452","id":117106393,"number":452,"title":"Api für SQL-Tabellen und -Spalten","user":{"login":"gharlan","id":330436,"avatar_url":"https://avatars.githubusercontent.com/u/330436?v=3","gravatar_id":"","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/redaxo/redaxo/labels/Feature","name":"Feature","color":"00BC09"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/redaxo/redaxo/milestones/1","html_url":"https://github.com/redaxo/redaxo/milestones/REDAXO%205.0","labels_url":"https://api.github.com/repos/redaxo/redaxo/milestones/1/labels","id":259285,"number":1,"title":"REDAXO 5.0","description":"","creator":{"login":"gharlan","id":330436,"avatar_url":"https://avatars.githubusercontent.com/u/330436?v=3","gravatar_id":"","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":314,"state":"open","created_at":"2013-02-04T11:40:55Z","updated_at":"2015-11-18T09:36:11Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-11-16T11:41:00Z","updated_at":"2015-11-18T11:03:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/redaxo/redaxo/pulls/452","html_url":"https://github.com/redaxo/redaxo/pull/452","diff_url":"https://github.com/redaxo/redaxo/pull/452.diff","patch_url":"https://github.com/redaxo/redaxo/pull/452.patch"},"body":"Addons wollen bei der Installation öfters Spalten zu anderen Tabellen hinzufügen.\r\nIn R4 haben wir dabei oft `ALTER TABLE` verwendet, und Fehler ignoriert (wenn Spalte schon vorhanden).\r\nDas wäre so in R5 kompliziert (try/catch pro Spalte), und finde ich sowieso so nicht sinnvoll.\r\nDaher habe ich für das Hinzufügen und Löschen von Spalten mal schnell eine Api geschrieben.\r\n\r\nWas haltet ihr davon?\r\n\r\nVerwendung siehe yrewrite: [install](https://github.com/yakamara/redaxo_yrewrite/blob/redaxo5/install.php#L13-L20) / [uninstall](https://github.com/yakamara/redaxo_yrewrite/blob/redaxo5/uninstall.php#L13-L20)\r\n\r\nDie Api kommt auch damit klar, wenn eine Spalte aus irgendeinem Grund doch schon vorhanden ist (zum Beispiel beim Re-Installieren), oder wenn die Spalte beim Löschen sowieso schon nicht mehr existierte.\r\n\r\nTODO\r\n- [ ] tabellen anlegen/löschen\r\n- [x] spalten anlegen/löschen\r\n- [ ] indexe/indizes anlegen/löschen"},"comment":{"url":"https://api.github.com/repos/redaxo/redaxo/issues/comments/157679780","html_url":"https://github.com/redaxo/redaxo/pull/452#issuecomment-157679780","issue_url":"https://api.github.com/repos/redaxo/redaxo/issues/452","id":157679780,"user":{"login":"staabm","id":120441,"avatar_url":"https://avatars.githubusercontent.com/u/120441?v=3","gravatar_id":"","url":"https://api.github.com/users/staabm","html_url":"https://github.com/staabm","followers_url":"https://api.github.com/users/staabm/followers","following_url":"https://api.github.com/users/staabm/following{/other_user}","gists_url":"https://api.github.com/users/staabm/gists{/gist_id}","starred_url":"https://api.github.com/users/staabm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staabm/subscriptions","organizations_url":"https://api.github.com/users/staabm/orgs","repos_url":"https://api.github.com/users/staabm/repos","events_url":"https://api.github.com/users/staabm/events{/privacy}","received_events_url":"https://api.github.com/users/staabm/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T11:03:40Z","updated_at":"2015-11-18T11:03:40Z","body":"> Tabellen erstellen und Indizes verwalten, würde ich wie gesagt gerne auf wann anders verschieben.\r\n\r\n:+1: "}}