code: private String createOrUpdateGraph(String version) {
          String oldVersion = null;
          Connection conn = this.sqlgGraph.tx().getConnection();
          try {
              DatabaseMetaData metadata = conn.getMetaData();
              String[] types = new String[]{"TABLE"};
              //load the vertices
              try (ResultSet vertexRs = metadata.getTables(null, Schema.SQLG_SCHEMA, Topology.VERTEX_PREFIX + Topology.GRAPH, types)) {
                  if (!vertexRs.next()) {
                      try (Statement statement = conn.createStatement()) {
                          String sql = this.sqlDialect.sqlgCreateTopologyGraph();
                          statement.execute(sql);
                          TopologyManager.addGraph(this.sqlgGraph, version);
                          oldVersion = version;
                      }
                  } else {
                      //Need to check if dbVersion has been added
                      try (ResultSet columnRs = metadata.getColumns(null, Schema.SQLG_SCHEMA, Topology.VERTEX_PREFIX + Topology.GRAPH, Topology.SQLG_SCHEMA_GRAPH_DB_VERSION)) {
                          if (!columnRs.next()) {
                              try (Statement statement = conn.createStatement()) {
                                  statement.execute(sqlDialect.addDbVersionToGraph(metadata));
                              }
                          }
                      }
                      GraphTraversalSource traversalSource = sqlgGraph.topology();
                      List<Vertex> graphVertices = traversalSource.V().hasLabel(SQLG_SCHEMA + "." + Topology.SQLG_SCHEMA_GRAPH).toList();
                      if (graphVertices.isEmpty()) {
                          TopologyManager.addGraph(this.sqlgGraph, version);
                          oldVersion = version;
                      } else {
                          oldVersion = TopologyManager.updateGraph(this.sqlgGraph, version);
                      }
                  }
                  return oldVersion;
              }
          } catch (SQLException e) {
              throw new RuntimeException(e);
          }
      }
docs: create or update the graph metadata
  
  @param version the new version of the graph
  @return the old version of the graph, or null if there was no graph