The zpm shell for sqlite enables foreign keys by default, so
it isn't necessary to do it manually.
# TODO check that we have such a package,version,release
#cat <<EOS
zpm shell $pkgfile <<EOS
# TODO check that we have such a package,version,release
#cat <<EOS
zpm shell $pkgfile <<EOS
-PRAGMA foreign_keys = ON;
begin;
insert or replace into packagefiles (package,version,release,path,mode,mtime,username,groupname,filetype,hash,target)
values ('$package', '$pkgver', $pkgrel, '$rpath', '$mode',$mtime, '$username','$groupname','$filetype',$hash,$target);
begin;
insert or replace into packagefiles (package,version,release,path,mode,mtime,username,groupname,filetype,hash,target)
values ('$package', '$pkgver', $pkgrel, '$rpath', '$mode',$mtime, '$username','$groupname','$filetype',$hash,$target);