{"action":"created","issue":{"url":"https://api.github.com/repos/4teamwork/opengever.core/issues/766","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/766/labels{/name}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/766/comments","events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/766/events","html_url":"https://github.com/4teamwork/opengever.core/issues/766","id":58887383,"number":766,"title":"SchemaMigration and PostgreSQL - DDL statements not executed","user":{"login":"deiferni","id":736583,"avatar_url":"https://avatars.githubusercontent.com/u/736583?v=3","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/4teamwork/opengever.core/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"lukasgraf","id":405124,"avatar_url":"https://avatars.githubusercontent.com/u/405124?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasgraf","html_url":"https://github.com/lukasgraf","followers_url":"https://api.github.com/users/lukasgraf/followers","following_url":"https://api.github.com/users/lukasgraf/following{/other_user}","gists_url":"https://api.github.com/users/lukasgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasgraf/subscriptions","organizations_url":"https://api.github.com/users/lukasgraf/orgs","repos_url":"https://api.github.com/users/lukasgraf/repos","events_url":"https://api.github.com/users/lukasgraf/events{/privacy}","received_events_url":"https://api.github.com/users/lukasgraf/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-02-25T11:27:13Z","updated_at":"2015-03-05T09:36:09Z","closed_at":null,"body":"It seems that DDL statements are not always committed when executing upgrades on a database with transactional ddl, i.e. PostgreSQL."},"comment":{"url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments/77333408","html_url":"https://github.com/4teamwork/opengever.core/issues/766#issuecomment-77333408","issue_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/766","id":77333408,"user":{"login":"lukasgraf","id":405124,"avatar_url":"https://avatars.githubusercontent.com/u/405124?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasgraf","html_url":"https://github.com/lukasgraf","followers_url":"https://api.github.com/users/lukasgraf/followers","following_url":"https://api.github.com/users/lukasgraf/following{/other_user}","gists_url":"https://api.github.com/users/lukasgraf/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasgraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasgraf/subscriptions","organizations_url":"https://api.github.com/users/lukasgraf/orgs","repos_url":"https://api.github.com/users/lukasgraf/repos","events_url":"https://api.github.com/users/lukasgraf/events{/privacy}","received_events_url":"https://api.github.com/users/lukasgraf/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T09:36:09Z","updated_at":"2015-03-05T09:36:09Z","body":"Apparently this is by design:\r\n\r\n> By default, zope.sqlalchemy puts sessions in an 'active' state when they are\r\n> first used. ORM write operations automatically move the session into a\r\n> 'changed' state. This avoids unnecessary database commits. Sometimes it\r\n> is necessary to interact with the database directly through SQL. It is not\r\n> possible to guess whether such an operation is a read or a write. Therefore we\r\n> must manually mark the session as changed when manual SQL statements write\r\n> to the DB.\r\n\r\n(From [`zope/sqlalchemy/README.txt`](https://github.com/zopefoundation/zope.sqlalchemy/blob/master/src/zope/sqlalchemy/README.txt#L145-L167))\r\n\r\nFlagging the session as changed using `mark_changed(session)` does the trick."}}