{"action":"created","issue":{"url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/issues/1342","repository_url":"https://api.github.com/repos/ezsystems/ezpublish-legacy","labels_url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/issues/1342/labels{/name}","comments_url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/issues/1342/comments","events_url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/issues/1342/events","html_url":"https://github.com/ezsystems/ezpublish-legacy/pull/1342","id":287813394,"number":1342,"title":"EZP-28706: Fixed hardcoded PostgreSQL sequence names","user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars1.githubusercontent.com/u/7099219?v=4","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"labels":[{"id":550094599,"url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/labels/Needs%20decision","name":"Needs decision","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-01-11T14:54:04Z","updated_at":"2018-03-19T08:53:16Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/pulls/1342","html_url":"https://github.com/ezsystems/ezpublish-legacy/pull/1342","diff_url":"https://github.com/ezsystems/ezpublish-legacy/pull/1342.diff","patch_url":"https://github.com/ezsystems/ezpublish-legacy/pull/1342.patch"},"body":"**JIRA issue**: https://jira.ez.no/browse/EZP-28706\r\n\r\nWith the release of ezpublish-kernel 7.0 there comes a change to PostgreSQL sequence naming.\r\nIf we combine eZ Platform v2, Kernel 7.0 and LegacyBridge we encounter a case when Legacy code still uses old naming convention, while updated database has new sequence names (for upgrade script see ezsystems/ezpublish-kernel#2216).\r\n\r\nSee also [this commit diff discussion](https://github.com/ezsystems/ezpublish-kernel/commit/2bda94087aa902e45b6cc3edde8e1870bde284e1#commitcomment-26623682).\r\n\r\nThis PR introduces one possible way to fix it, however not an ideal one as it performs an extra fetch (not to mention spaghetti code implementing it ;) ).\r\nNote that I'm not changing `correctSequenceValues` method on purpose. This is used by Legacy installer which has separate schema definition, so it would require changing entire schema. The real use case exists IMHO only for existing installations.\r\n\r\nI tried to use for this `pg_get_serial_sequence` stored function, but as name suggests works only for SERIAL type, not any table/column bound to nextval of sequence.\r\n\r\nOther possible solutions:\r\n- Optimize code to generate statement and inject it into `SELECT currval( ... )` instead of pre-fetching.\r\n- Release new version of `ezpublish-legacy` which is aligned with new naming convention and any other BC breaks introduced by 7.0 (seems actually most sane to me).\r\n- introduce configuration option to set sequence name pattern (could be tricky).\r\n\r\nReverting sequence names to old names in Kernel 7.0 blocks implementation of unified installer using Doctrine Schema tool, as its API translates `autoincrement` to `SERIAL` data type and `table_column_seq` sequence name.\r\n\r\nPOV ping @andrerom @emodric @wizhippo \r\n\r\n**TODO**:\r\n- [ ] Decide which solution to choose.\r\n- [ ] Discover if there are other places that need change, taking into the account above notes.\r\n- [x] Implement solution with extra fetch"},"comment":{"url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/issues/comments/374140553","html_url":"https://github.com/ezsystems/ezpublish-legacy/pull/1342#issuecomment-374140553","issue_url":"https://api.github.com/repos/ezsystems/ezpublish-legacy/issues/1342","id":374140553,"user":{"login":"alongosz","id":7099219,"avatar_url":"https://avatars1.githubusercontent.com/u/7099219?v=4","gravatar_id":"","url":"https://api.github.com/users/alongosz","html_url":"https://github.com/alongosz","followers_url":"https://api.github.com/users/alongosz/followers","following_url":"https://api.github.com/users/alongosz/following{/other_user}","gists_url":"https://api.github.com/users/alongosz/gists{/gist_id}","starred_url":"https://api.github.com/users/alongosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alongosz/subscriptions","organizations_url":"https://api.github.com/users/alongosz/orgs","repos_url":"https://api.github.com/users/alongosz/repos","events_url":"https://api.github.com/users/alongosz/events{/privacy}","received_events_url":"https://api.github.com/users/alongosz/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T08:53:16Z","updated_at":"2018-03-19T08:53:16Z","author_association":"MEMBER","body":"Ok, closing due to last comment (I must have lost it in the stream of notifications some time ago ;) )"}}
{"actor":{"display_login":"alongosz"}}