Fix prob with SQL not using unique identities
Merge branch 'newperiod' into mediawiki