I just upgraded my weblinks on postgres from 5.x-whatever to 6.x-2.x and got some SQL errors. It's not likely that many people are going to see the first few errors anymore, but I thought I'd create a patch anyway.

Some remarks on a few things I encountered:

* in weblinks_update_6110(),
- NO index on 'urlhash' is created if the index on 'url' did not exist. On my pgsql installation it did not exist, so I decided to create one always. (See the code.)
- I did not change the code for mysql and I guess it is up to you to decide if you need to make another update, to conditionally create the 'urlhash' index.

* in weblinks_update_6115(),
- the first two update statements were identical, therefore superfluous. I deleted one.
- I made two 'case' blocks instead of reordering code, so you can better see what I added. (Even though the code is a bit bloated now, maybe.)

Comments

bfo’s picture

I'm about to move my site from 5.x to 6.x and my links from linksDB to this and the patch will come in very useful.

Thanks

nancydru’s picture

Most of that is because of people re-applying updates (and wondering why it fails) or making really big update jumps.

Thanks for the patch, I committed it.

@bfo: This will be in the next -dev release in an hour or so, and in 6.x-2.1, which is due out shortly.

nancydru’s picture

Status: Active » Fixed
bfo’s picture

Status: Fixed » Active
StatusFileSize
new48.47 KB

Hi

I'm still having an issue with this.

I tried the dev version: weblinks-6.x-2.x-dev

and still get errors, see attached screenshot

Thanks

bfo

nancydru’s picture

Status: Active » Fixed
nancydru’s picture

Status: Fixed » Closed (fixed)

Included in 6.x-2.1.