Add db/legacy_version.pl script