{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/9759","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9759/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9759/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9759/events","html_url":"https://github.com/joomla/joomla-cms/pull/9759","id":146292824,"number":9759,"title":"Fix inconsisteny between new install and update for NOT NULL of urls columns of redirect_links table","user":{"login":"richard67","id":7413183,"avatar_url":"https://avatars.githubusercontent.com/u/7413183?v=3","gravatar_id":"","url":"https://api.github.com/users/richard67","html_url":"https://github.com/richard67","followers_url":"https://api.github.com/users/richard67/followers","following_url":"https://api.github.com/users/richard67/following{/other_user}","gists_url":"https://api.github.com/users/richard67/gists{/gist_id}","starred_url":"https://api.github.com/users/richard67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard67/subscriptions","organizations_url":"https://api.github.com/users/richard67/orgs","repos_url":"https://api.github.com/users/richard67/repos","events_url":"https://api.github.com/users/richard67/events{/privacy}","received_events_url":"https://api.github.com/users/richard67/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-04-06T12:01:30Z","updated_at":"2016-05-06T07:33:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/9759","html_url":"https://github.com/joomla/joomla-cms/pull/9759","diff_url":"https://github.com/joomla/joomla-cms/pull/9759.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/9759.patch"},"body":"Pull Request for new issue.\r\n\r\nRelevant for all database types.\r\n\r\n#### Summary of Changes\r\n\r\nWith PR #9269 for enlargement of URL colums in the \"redirect_links\" table, a \"NOT NULL\" constraint for the \"new_url\" column was accidently added in schema update scripts \"3.5.2-2016-04-06.sql\" for mysql and sqlazure, which does not exist in the create table statement for new installation.\r\n\r\nWith the same PR, the \"NOT NULL\" constraints for the \"old_url\" and \"referer\" columns were missing in the schema update script \"3.5.2-2016-04-06.sql\" for postgresql, which is also not consistent with a new installation.\r\n\r\nThis PR corrects these inconsistencies between update and new install by new schema update scripts for updating from a 3.5.0 or 3.5.1.\r\n\r\nIn addition, the old schema updates \"3.5.2-2016-04-06.sql\" are corrected, too, so pre-3.5.0 versions will not be updated in the wrong way.\r\n\r\n@shur Thanks for reporting this issue to me.\r\n\r\n#### Testing Instructions\r\n\r\n##### Pre-requisites, important!!! #####\r\n\r\n1. This PR cannot be tested on a newly installed current staging, because there the database schema is of course consistent, so the issue does not appear.\r\n2. Due to the limited capabilities of the database schema manager aka \"database fix\", you cannot use patchtester and then do a database fix to apply this PR.\r\n3. For the same reason, you cannot use the \"copy or unzip the files on the server and then run the database fix\" method for updating to latest staging + this PR, you have to use the custom URL and Joomla! Update Component.\r\n\r\nSo as a starting point, use a pre-3.5.0, e.g. a 3.4.8 for this test. No need to test several older versions, a 3.4.8 is sufficient.\r\n\r\nFinally, please mention in the comment which database type(s) you have tested when setting your test result.\r\n\r\n##### Test Steps #####\r\n\r\nStep 1: On a Joomla! pre-3.5.0, e.g. a 3.4.8, check e.g. with phpMyAdmin (or in case of PostgreSQL with phpPgAdmin, or in case of Microsoft stuff, the Microsoft tool) that in your database, column \"new_url\" of the redirect_links table does not have a \"NOT NULL\" constraint, i.e. NULL values are allowed, and columns \"old_url\" and \"referer\" have a \"NOT NULL\" constraint, i.e. NULL values are not allowed.\r\n\r\nResult: \"NOT NULL\" constraints are as described.\r\n\r\nStep 2: Update to 3.5.0 or 3.5.1 (does not matter which one).\r\n\r\nStep 3: Check e.g. e.g. with phpMyAdmin (or phpPgAdmin or MS tool) the \"NOT NULL\" constrains of columns \"old_url\", \"new_url\" and \"referer\" of the redirect_links table in your database.\r\n\r\nResult compared to Step 1:\r\n- On mysql and sqlazure/sqlsrv databases: There is now a \"NOT NULL\" constraint for column \"new_url\".\r\n- On postgresql databases: The \"NOT NULL\" constraints for column \"old_url\" and \"referer\" are missing.\r\n\r\nStep 4: Check with a text editor or on command line (e.g. on Linux: less command) the \"NOT NULL\" constrains of these columns in the SQL statement where the table is created in file \"installation/sql/<dbtype>/joomla.sql\", where <dbtype> is your database server type mysql, postgresql or sqlazure (= sqlsrv).\r\n\r\nResult: According to the joomla.sql the \"NOT NULL\" constraints shouldn't have changed compared to Step 1.\r\n\r\nStep 5: Update to current staging + this PR = a patched 3.6.0-dev, using following custom URL: [http://test5.richard-fath.de/list_test7.xml](http://test5.richard-fath.de/list_test7.xml \"http://test5.richard-fath.de/list_test7.xml\").\r\n\r\nStep 6: Check e.g. e.g. with phpMyAdmin (or phpPgAdmin or MS tool) the \"NOT NULL\" constrains of columns \"old_url\", \"new_url\" and \"referer\" of the redirect_links table in your database.\r\n\r\nResult: The \"NOT NULL\" constrains of columns \"old_url\", \"new_url\" and \"referer\" of the redirect_links table are as described in Step 1. \r\n\r\nStep 7: Check with a text editor or on command line (e.g. on Linux: less command) the \"NOT NULL\" constrains of these columns in the SQL statement where the table is created in file \"installation/sql/<dbtype>/joomla.sql\"\r\n\r\nResult: Also according to the joomla.sql the \"NOT NULL\" constraints shouldn't have changed compared to Step 1."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/217370774","html_url":"https://github.com/joomla/joomla-cms/pull/9759#issuecomment-217370774","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9759","id":217370774,"user":{"login":"richard67","id":7413183,"avatar_url":"https://avatars.githubusercontent.com/u/7413183?v=3","gravatar_id":"","url":"https://api.github.com/users/richard67","html_url":"https://github.com/richard67","followers_url":"https://api.github.com/users/richard67/followers","following_url":"https://api.github.com/users/richard67/following{/other_user}","gists_url":"https://api.github.com/users/richard67/gists{/gist_id}","starred_url":"https://api.github.com/users/richard67/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richard67/subscriptions","organizations_url":"https://api.github.com/users/richard67/orgs","repos_url":"https://api.github.com/users/richard67/repos","events_url":"https://api.github.com/users/richard67/events{/privacy}","received_events_url":"https://api.github.com/users/richard67/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T07:33:48Z","updated_at":"2016-05-06T07:33:48Z","body":"@shur Thanks for testing."}}