{"action":"created","comment":{"url":"https://api.github.com/repos/redaxo/redaxo/pulls/comments/44920558","id":44920558,"diff_hunk":"@@ -0,0 +1,51 @@\n+<?php\n+\n+/**\n+ * Class to represent sql columns.\n+ *\n+ * @author gharlan\n+ *\n+ * @package redaxo\\core\n+ */\n+class rex_sql_column\n+{\n+    private $name;\n+    private $type;\n+    private $nullable;\n+    private $default;\n+    private $extra;\n+\n+    public function __construct($name, $type, $nullable = false, $default = null, $extra = null)","path":"redaxo/src/core/lib/sql/column.php","position":18,"original_position":18,"commit_id":"5cf625784eac7c64044d19092b281f8248de48a6","original_commit_id":"5cf625784eac7c64044d19092b281f8248de48a6","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},"body":"phpdoc damit man die typen der nötigen vars weiß","created_at":"2015-11-16T13:06:02Z","updated_at":"2015-11-16T13:06:02Z","html_url":"https://github.com/redaxo/redaxo/pull/452#discussion_r44920558","pull_request_url":"https://api.github.com/repos/redaxo/redaxo/pulls/452","_links":{"self":{"href":"https://api.github.com/repos/redaxo/redaxo/pulls/comments/44920558"},"html":{"href":"https://github.com/redaxo/redaxo/pull/452#discussion_r44920558"},"pull_request":{"href":"https://api.github.com/repos/redaxo/redaxo/pulls/452"}}},"pull_request":{"url":"https://api.github.com/repos/redaxo/redaxo/pulls/452","id":50800113,"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","issue_url":"https://api.github.com/repos/redaxo/redaxo/issues/452","number":452,"state":"open","locked":false,"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},"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.","created_at":"2015-11-16T11:40:59Z","updated_at":"2015-11-16T13:06:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37ab695ffb4dc45e96520597e85dec86629f6ae8","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":21,"closed_issues":308,"state":"open","created_at":"2013-02-04T11:40:55Z","updated_at":"2015-11-16T11:57:34Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/redaxo/redaxo/pulls/452/commits","review_comments_url":"https://api.github.com/repos/redaxo/redaxo/pulls/452/comments","review_comment_url":"https://api.github.com/repos/redaxo/redaxo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redaxo/redaxo/issues/452/comments","statuses_url":"https://api.github.com/repos/redaxo/redaxo/statuses/5cf625784eac7c64044d19092b281f8248de48a6","head":{"label":"redaxo:table-api","ref":"table-api","sha":"5cf625784eac7c64044d19092b281f8248de48a6","user":{"login":"redaxo","id":280216,"avatar_url":"https://avatars.githubusercontent.com/u/280216?v=3","gravatar_id":"","url":"https://api.github.com/users/redaxo","html_url":"https://github.com/redaxo","followers_url":"https://api.github.com/users/redaxo/followers","following_url":"https://api.github.com/users/redaxo/following{/other_user}","gists_url":"https://api.github.com/users/redaxo/gists{/gist_id}","starred_url":"https://api.github.com/users/redaxo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redaxo/subscriptions","organizations_url":"https://api.github.com/users/redaxo/orgs","repos_url":"https://api.github.com/users/redaxo/repos","events_url":"https://api.github.com/users/redaxo/events{/privacy}","received_events_url":"https://api.github.com/users/redaxo/received_events","type":"Organization","site_admin":false},"repo":{"id":756485,"name":"redaxo","full_name":"redaxo/redaxo","owner":{"login":"redaxo","id":280216,"avatar_url":"https://avatars.githubusercontent.com/u/280216?v=3","gravatar_id":"","url":"https://api.github.com/users/redaxo","html_url":"https://github.com/redaxo","followers_url":"https://api.github.com/users/redaxo/followers","following_url":"https://api.github.com/users/redaxo/following{/other_user}","gists_url":"https://api.github.com/users/redaxo/gists{/gist_id}","starred_url":"https://api.github.com/users/redaxo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redaxo/subscriptions","organizations_url":"https://api.github.com/users/redaxo/orgs","repos_url":"https://api.github.com/users/redaxo/repos","events_url":"https://api.github.com/users/redaxo/events{/privacy}","received_events_url":"https://api.github.com/users/redaxo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redaxo/redaxo","description":"REDAXO CMS","fork":false,"url":"https://api.github.com/repos/redaxo/redaxo","forks_url":"https://api.github.com/repos/redaxo/redaxo/forks","keys_url":"https://api.github.com/repos/redaxo/redaxo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redaxo/redaxo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redaxo/redaxo/teams","hooks_url":"https://api.github.com/repos/redaxo/redaxo/hooks","issue_events_url":"https://api.github.com/repos/redaxo/redaxo/issues/events{/number}","events_url":"https://api.github.com/repos/redaxo/redaxo/events","assignees_url":"https://api.github.com/repos/redaxo/redaxo/assignees{/user}","branches_url":"https://api.github.com/repos/redaxo/redaxo/branches{/branch}","tags_url":"https://api.github.com/repos/redaxo/redaxo/tags","blobs_url":"https://api.github.com/repos/redaxo/redaxo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redaxo/redaxo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redaxo/redaxo/git/refs{/sha}","trees_url":"https://api.github.com/repos/redaxo/redaxo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redaxo/redaxo/statuses/{sha}","languages_url":"https://api.github.com/repos/redaxo/redaxo/languages","stargazers_url":"https://api.github.com/repos/redaxo/redaxo/stargazers","contributors_url":"https://api.github.com/repos/redaxo/redaxo/contributors","subscribers_url":"https://api.github.com/repos/redaxo/redaxo/subscribers","subscription_url":"https://api.github.com/repos/redaxo/redaxo/subscription","commits_url":"https://api.github.com/repos/redaxo/redaxo/commits{/sha}","git_commits_url":"https://api.github.com/repos/redaxo/redaxo/git/commits{/sha}","comments_url":"https://api.github.com/repos/redaxo/redaxo/comments{/number}","issue_comment_url":"https://api.github.com/repos/redaxo/redaxo/issues/comments{/number}","contents_url":"https://api.github.com/repos/redaxo/redaxo/contents/{+path}","compare_url":"https://api.github.com/repos/redaxo/redaxo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redaxo/redaxo/merges","archive_url":"https://api.github.com/repos/redaxo/redaxo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redaxo/redaxo/downloads","issues_url":"https://api.github.com/repos/redaxo/redaxo/issues{/number}","pulls_url":"https://api.github.com/repos/redaxo/redaxo/pulls{/number}","milestones_url":"https://api.github.com/repos/redaxo/redaxo/milestones{/number}","notifications_url":"https://api.github.com/repos/redaxo/redaxo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redaxo/redaxo/labels{/name}","releases_url":"https://api.github.com/repos/redaxo/redaxo/releases{/id}","created_at":"2010-07-04T16:46:03Z","updated_at":"2015-11-06T14:21:31Z","pushed_at":"2015-11-16T13:05:01Z","git_url":"git://github.com/redaxo/redaxo.git","ssh_url":"git@github.com:redaxo/redaxo.git","clone_url":"https://github.com/redaxo/redaxo.git","svn_url":"https://github.com/redaxo/redaxo","homepage":"www.redaxo.org","size":26416,"stargazers_count":90,"watchers_count":90,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":104,"forks":23,"open_issues":104,"watchers":90,"default_branch":"master"}},"base":{"label":"redaxo:master","ref":"master","sha":"65e69ddfddebac783214a4dd7c271515fa7afa89","user":{"login":"redaxo","id":280216,"avatar_url":"https://avatars.githubusercontent.com/u/280216?v=3","gravatar_id":"","url":"https://api.github.com/users/redaxo","html_url":"https://github.com/redaxo","followers_url":"https://api.github.com/users/redaxo/followers","following_url":"https://api.github.com/users/redaxo/following{/other_user}","gists_url":"https://api.github.com/users/redaxo/gists{/gist_id}","starred_url":"https://api.github.com/users/redaxo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redaxo/subscriptions","organizations_url":"https://api.github.com/users/redaxo/orgs","repos_url":"https://api.github.com/users/redaxo/repos","events_url":"https://api.github.com/users/redaxo/events{/privacy}","received_events_url":"https://api.github.com/users/redaxo/received_events","type":"Organization","site_admin":false},"repo":{"id":756485,"name":"redaxo","full_name":"redaxo/redaxo","owner":{"login":"redaxo","id":280216,"avatar_url":"https://avatars.githubusercontent.com/u/280216?v=3","gravatar_id":"","url":"https://api.github.com/users/redaxo","html_url":"https://github.com/redaxo","followers_url":"https://api.github.com/users/redaxo/followers","following_url":"https://api.github.com/users/redaxo/following{/other_user}","gists_url":"https://api.github.com/users/redaxo/gists{/gist_id}","starred_url":"https://api.github.com/users/redaxo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redaxo/subscriptions","organizations_url":"https://api.github.com/users/redaxo/orgs","repos_url":"https://api.github.com/users/redaxo/repos","events_url":"https://api.github.com/users/redaxo/events{/privacy}","received_events_url":"https://api.github.com/users/redaxo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redaxo/redaxo","description":"REDAXO CMS","fork":false,"url":"https://api.github.com/repos/redaxo/redaxo","forks_url":"https://api.github.com/repos/redaxo/redaxo/forks","keys_url":"https://api.github.com/repos/redaxo/redaxo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redaxo/redaxo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redaxo/redaxo/teams","hooks_url":"https://api.github.com/repos/redaxo/redaxo/hooks","issue_events_url":"https://api.github.com/repos/redaxo/redaxo/issues/events{/number}","events_url":"https://api.github.com/repos/redaxo/redaxo/events","assignees_url":"https://api.github.com/repos/redaxo/redaxo/assignees{/user}","branches_url":"https://api.github.com/repos/redaxo/redaxo/branches{/branch}","tags_url":"https://api.github.com/repos/redaxo/redaxo/tags","blobs_url":"https://api.github.com/repos/redaxo/redaxo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redaxo/redaxo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redaxo/redaxo/git/refs{/sha}","trees_url":"https://api.github.com/repos/redaxo/redaxo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redaxo/redaxo/statuses/{sha}","languages_url":"https://api.github.com/repos/redaxo/redaxo/languages","stargazers_url":"https://api.github.com/repos/redaxo/redaxo/stargazers","contributors_url":"https://api.github.com/repos/redaxo/redaxo/contributors","subscribers_url":"https://api.github.com/repos/redaxo/redaxo/subscribers","subscription_url":"https://api.github.com/repos/redaxo/redaxo/subscription","commits_url":"https://api.github.com/repos/redaxo/redaxo/commits{/sha}","git_commits_url":"https://api.github.com/repos/redaxo/redaxo/git/commits{/sha}","comments_url":"https://api.github.com/repos/redaxo/redaxo/comments{/number}","issue_comment_url":"https://api.github.com/repos/redaxo/redaxo/issues/comments{/number}","contents_url":"https://api.github.com/repos/redaxo/redaxo/contents/{+path}","compare_url":"https://api.github.com/repos/redaxo/redaxo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redaxo/redaxo/merges","archive_url":"https://api.github.com/repos/redaxo/redaxo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redaxo/redaxo/downloads","issues_url":"https://api.github.com/repos/redaxo/redaxo/issues{/number}","pulls_url":"https://api.github.com/repos/redaxo/redaxo/pulls{/number}","milestones_url":"https://api.github.com/repos/redaxo/redaxo/milestones{/number}","notifications_url":"https://api.github.com/repos/redaxo/redaxo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redaxo/redaxo/labels{/name}","releases_url":"https://api.github.com/repos/redaxo/redaxo/releases{/id}","created_at":"2010-07-04T16:46:03Z","updated_at":"2015-11-06T14:21:31Z","pushed_at":"2015-11-16T13:05:01Z","git_url":"git://github.com/redaxo/redaxo.git","ssh_url":"git@github.com:redaxo/redaxo.git","clone_url":"https://github.com/redaxo/redaxo.git","svn_url":"https://github.com/redaxo/redaxo","homepage":"www.redaxo.org","size":26416,"stargazers_count":90,"watchers_count":90,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":104,"forks":23,"open_issues":104,"watchers":90,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redaxo/redaxo/pulls/452"},"html":{"href":"https://github.com/redaxo/redaxo/pull/452"},"issue":{"href":"https://api.github.com/repos/redaxo/redaxo/issues/452"},"comments":{"href":"https://api.github.com/repos/redaxo/redaxo/issues/452/comments"},"review_comments":{"href":"https://api.github.com/repos/redaxo/redaxo/pulls/452/comments"},"review_comment":{"href":"https://api.github.com/repos/redaxo/redaxo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redaxo/redaxo/pulls/452/commits"},"statuses":{"href":"https://api.github.com/repos/redaxo/redaxo/statuses/5cf625784eac7c64044d19092b281f8248de48a6"}}}}