@@ -1279,7 +1279,7 @@ public void moduleStartupComplete(ServletContext servletContext)
12791279 ContainerManager .addContainerListener (new EmailPreferenceContainerListener ());
12801280 UserManager .addUserListener (new EmailPreferenceUserListener ());
12811281
1282- DatabaseMigrationService .get ().registerHandler (new DefaultMigrationSchemaHandler (CoreSchema .getInstance ().getSchema ())
1282+ DatabaseMigrationService .get ().registerSchemaHandler (new DefaultMigrationSchemaHandler (CoreSchema .getInstance ().getSchema ())
12831283 {
12841284 @ Override
12851285 public void beforeVerification ()
@@ -1319,7 +1319,8 @@ public List<TableInfo> getTablesToCopy()
13191319 case "ContainerAliases" -> FieldKey .fromParts ("ContainerRowId" , "EntityId" );
13201320 case "Containers" -> FieldKey .fromParts ("EntityId" );
13211321 case "Report" -> FieldKey .fromParts ("ContainerId" );
1322- case "APIKeys" , "AuthenticationConfigurations" , "EmailOptions" , "Logins" , "ReportEngines" , "ShortURL" , "UsersData" -> SITE_WIDE_TABLE ;
1322+ // Note: DataStates is not really site-wide, but there seem to be exp.Materials referencing DataStates with conflicting containers
1323+ case "APIKeys" , "AuthenticationConfigurations" , "DataStates" , "EmailOptions" , "Logins" , "ReportEngines" , "ShortURL" , "UsersData" -> SITE_WIDE_TABLE ;
13231324 default -> super .getContainerFieldKey (sourceTable );
13241325 };
13251326 }
@@ -1338,16 +1339,6 @@ public FilterClause getContainerClause(TableInfo sourceTable, FieldKey container
13381339 containerClause = orClause ;
13391340 }
13401341
1341- if (sourceTable .getName ().equals ("Documents" ))
1342- {
1343- // If labbook module is present then filter out the rows in the root that are associated with the
1344- // canonical attachment parent and *don't* have attachment pointers in the desired containers.
1345- // So that would be something like:
1346- // containerClause AND NOT (Container = <RootId> AND Parent = <CanonicalParentId> AND DocumentName NOT IN (
1347- // SELECT hash WHERE SourceId IN (THE SIX DIFFERENT CASES OF SourceId)
1348- // )
1349- }
1350-
13511342 return containerClause ;
13521343 }
13531344
@@ -1359,15 +1350,15 @@ public void afterSchema()
13591350 }
13601351 });
13611352
1362- DatabaseMigrationService .get ().registerHandler (new DefaultMigrationSchemaHandler (PropertySchema .getInstance ().getSchema ()){
1353+ DatabaseMigrationService .get ().registerSchemaHandler (new DefaultMigrationSchemaHandler (PropertySchema .getInstance ().getSchema ()){
13631354 @ Override
13641355 public @ Nullable FieldKey getContainerFieldKey (TableInfo sourceTable )
13651356 {
13661357 return sourceTable .getName ().equals ("PropertySets" ) ? FieldKey .fromParts ("ObjectId" ) : super .getContainerFieldKey (sourceTable );
13671358 }
13681359 });
13691360
1370- DatabaseMigrationService .get ().registerHandler (new DefaultMigrationSchemaHandler (TestSchema .getInstance ().getSchema ()){
1361+ DatabaseMigrationService .get ().registerSchemaHandler (new DefaultMigrationSchemaHandler (TestSchema .getInstance ().getSchema ()){
13711362 @ Override
13721363 public List <TableInfo > getTablesToCopy ()
13731364 {
@@ -1378,7 +1369,7 @@ public List<TableInfo> getTablesToCopy()
13781369 // TODO: Temporary, until "clone" migration type copies schemas with a registered handler only
13791370 if (ModuleLoader .getInstance ().getModule (DbScope .getLabKeyScope (), "vehicle" ) != null )
13801371 {
1381- DatabaseMigrationService .get ().registerHandler (new DefaultMigrationSchemaHandler (DbSchema .get ("vehicle" , DbSchemaType .Module ))
1372+ DatabaseMigrationService .get ().registerSchemaHandler (new DefaultMigrationSchemaHandler (DbSchema .get ("vehicle" , DbSchemaType .Module ))
13821373 {
13831374 @ Override
13841375 public List <TableInfo > getTablesToCopy ()
0 commit comments