Esempio n. 1
0
 private void setUsernameCaseInsensitive(ODatabaseRecordTx db) {
   Logger.info("..updating ouser.name collate CI..:");
   DbHelper.execMultiLineCommands(
       db,
       Logger.isDebugEnabled(),
       "drop index ouser.name;",
       "alter property ouser.name collate ci;",
       "create index ouser.name unique;");
   Logger.info("...done...");
 }
Esempio n. 2
0
 private void idOnEdgeClass(ODatabaseRecordTx db) {
   Logger.info("..creating id property on E class...:");
   DbHelper.execMultiLineCommands(
       db,
       true,
       "create property E.id String;",
       "alter property E.id notnull=true;",
       "create index E.id unique;");
   Logger.info("...done...");
 }
Esempio n. 3
0
 private void addPermissionsClass(ODatabaseRecordTx db) {
   Logger.info("..creating database permissions class...:");
   DbHelper.execMultiLineCommands(
       db,
       true,
       "create class _BB_Permissions;",
       "create property _BB_Permissions.tag String;",
       "create property _BB_Permissions.enabled boolean;",
       "alter property _BB_Permissions.tag mandatory=true;",
       "alter property _BB_Permissions.tag notnull=true;",
       "alter property _BB_Permissions.enabled mandatory=true;",
       "alter property _BB_Permissions.enabled notnull=true;",
       "create index _BB_Permissions.tag unique;");
   DbHelper.createDefaultPermissionTags();
   Logger.info("...done...");
 }
Esempio n. 4
0
 private void setGraphDefaultValues(ODatabaseRecordTx db) {
   Logger.info("..updating graph custom attributes..:");
   //		String[] script=new String[]{
   //				"alter database custom useLightweightEdges=true;",
   //				"alter database custom useClassForEdgeLabel=true",
   //				"alter database custom useClassForVertexLabel=true",
   //				"alter database custom useVertexFieldsForEdgeLabels=true"};
   //		for (String line:script){
   //			Logger.debug(line);
   //			if (!line.startsWith("--") && !line.trim().isEmpty()){ //skip comments
   //				db.command(new OCommandSQL(line.replace(';', ' '))).execute();
   //			}
   //		}
   DbHelper.execMultiLineCommands(
       db,
       true,
       "alter database custom useLightweightEdges=false;",
       "alter database custom useClassForEdgeLabel=false",
       "alter database custom useClassForVertexLabel=true",
       "alter database custom useVertexFieldsForEdgeLabels=true");
   Logger.info("...done...");
 }