private VersionException initializeDatabase(OpenMode openMode)
			throws IOException, VersionException {

		table = dbh.getTable(TABLE_NAME);
		if (table == null) {
			if (openMode == OpenMode.UPGRADE) {
				createDatabase();
			}
			else {
				throw new VersionException(true);
			}
		}

		int storedVersion = getStoredVersion();
		if (storedVersion > DB_VERSION) {
			throw new VersionException(VersionException.NEWER_VERSION, false);
		}
		if (openMode != OpenMode.UPGRADE && storedVersion < UPGRADE_REQUIRED_BEFORE_VERSION) {
			return new VersionException(true);
		}
		if (openMode == OpenMode.UPDATE && storedVersion < DB_VERSION) {
			return new VersionException(true);
		}
		return null;
	}
Initialize the following fields from the database and check the database version for an existing database:
<ul>
<li>name</li>
<li>languageName</li>
<li>languageVersion</li>
<li>LanguageMinorVersion</li>
</ul>
@param openMode program open mode
@return version exception if the current version is out of date and can be upgraded.
@throws IOException
@throws VersionException if the data is newer than this version of Ghidra and can not be
upgraded or opened.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/DataTypeArchiveDB.java