Fix sql script so it can run as wikidev

Change-Id: Id6d8403aa38f52fcbae1d356a62b6aa7b42f38fc