I've managed to solve this issue myself. My assumption that the database migration script incorrectly sets HasContents to FALSE is true (we've tested this).
For those interested, I've written the following Python script to generate a usable SQL script to fix the issue:
import sys;
import os;
mycount = 0
def fixHasContents(basepath):
if os.path.exists(basepath) and os.path.isdir(basepath):
files = os.listdir(basepath)
for f in files:
listMxFiles(basepath, f)
print "count: %i" % mycount
else:
print "Basepath '%s' does not exist or is not a directory" % basepath
def listMxFiles(basepath, file):
global mycount
filepath = basepath + os.sep + file
if os.path.isfile(filepath):
if file.isdigit():
print "update system$filedocument set hascontents = 1 where id = %s;" % file
mycount = mycount + 1
else:
if file.isdigit():
files = os.listdir(filepath)
for f in files:
listMxFiles(filepath, f)
def printUsage():
print "Usage: fixHasContents.py <data files basepath>"
if __name__ == "__main__":
if len(sys.argv) > 1:
basepath = os.path.realpath(sys.argv[1])
print "Reading Mendix data files from basepath: %s" % basepath
fixHasContents(basepath)
else:
printUsage()