mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Activity Service -fix schema bootstrap
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9146 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -67,5 +67,5 @@ INSERT INTO alf_applied_patch
|
|||||||
VALUES
|
VALUES
|
||||||
(
|
(
|
||||||
'patch.db-V3.0-0-CreateActivitiesTables', 'Executed script create V3.0: Created activities tables',
|
'patch.db-V3.0-0-CreateActivitiesTables', 'Executed script create V3.0: Created activities tables',
|
||||||
0, 125, -1, 126, null, 'UNKNOWN', 1, 1, 'Script completed'
|
0, 125, -1, 126, NOW, 'UNKNOWN', 1, 1, 'Script completed'
|
||||||
);
|
);
|
||||||
|
@@ -64,5 +64,5 @@ INSERT INTO alf_applied_patch
|
|||||||
VALUES
|
VALUES
|
||||||
(
|
(
|
||||||
'patch.db-V3.0-0-CreateActivitiesTables', 'Executed script create V3.0: Created activities tables',
|
'patch.db-V3.0-0-CreateActivitiesTables', 'Executed script create V3.0: Created activities tables',
|
||||||
0, 125, -1, 126, null, 'UNKNOWN', 1, 1, 'Script completed'
|
0, 125, -1, 126, now(), 'UNKNOWN', 1, 1, 'Script completed'
|
||||||
);
|
);
|
@@ -73,5 +73,5 @@ INSERT INTO alf_applied_patch
|
|||||||
VALUES
|
VALUES
|
||||||
(
|
(
|
||||||
'patch.db-V3.0-0-CreateActivitiesTables', 'Executed script create V3.0: Created activities tables',
|
'patch.db-V3.0-0-CreateActivitiesTables', 'Executed script create V3.0: Created activities tables',
|
||||||
0, 125, -1, 126, null, 'UNKNOWN', 1, 1, 'Script completed'
|
0, 125, -1, 126, SYSDATE, 'UNKNOWN', 1, 1, 'Script completed'
|
||||||
);
|
);
|
||||||
|
@@ -535,7 +535,7 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
|||||||
/**
|
/**
|
||||||
* Builds the schema from scratch or applies the necessary patches to the schema.
|
* Builds the schema from scratch or applies the necessary patches to the schema.
|
||||||
*/
|
*/
|
||||||
private void updateSchema(Configuration cfg, Session session, Connection connection) throws Exception
|
private boolean updateSchema(Configuration cfg, Session session, Connection connection) throws Exception
|
||||||
{
|
{
|
||||||
boolean create = false;
|
boolean create = false;
|
||||||
try
|
try
|
||||||
@@ -604,6 +604,8 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
|||||||
// Execute any post-auto-update scripts
|
// Execute any post-auto-update scripts
|
||||||
checkSchemaPatchScripts(cfg, session, connection, postUpdateScriptPatches, true);
|
checkSchemaPatchScripts(cfg, session, connection, postUpdateScriptPatches, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return create;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -956,7 +958,7 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
|||||||
// Allocate buffer for executed statements
|
// Allocate buffer for executed statements
|
||||||
executedStatementsThreadLocal.set(new StringBuilder(1024));
|
executedStatementsThreadLocal.set(new StringBuilder(1024));
|
||||||
|
|
||||||
updateSchema(cfg, session, connection);
|
boolean create = updateSchema(cfg, session, connection);
|
||||||
|
|
||||||
// Copy the executed statements to the output file
|
// Copy the executed statements to the output file
|
||||||
File schemaOutputFile = null;
|
File schemaOutputFile = null;
|
||||||
@@ -981,10 +983,13 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
|||||||
LogUtil.info(logger, MSG_ALL_STATEMENTS, schemaOutputFile.getPath());
|
LogUtil.info(logger, MSG_ALL_STATEMENTS, schemaOutputFile.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify that all patches have been applied correctly
|
if (! create)
|
||||||
checkSchemaPatchScripts(cfg, session, connection, validateUpdateScriptPatches, false); // check scripts
|
{
|
||||||
checkSchemaPatchScripts(cfg, session, connection, preUpdateScriptPatches, false); // check scripts
|
// verify that all patches have been applied correctly
|
||||||
checkSchemaPatchScripts(cfg, session, connection, postUpdateScriptPatches, false); // check scripts
|
checkSchemaPatchScripts(cfg, session, connection, validateUpdateScriptPatches, false); // check scripts
|
||||||
|
checkSchemaPatchScripts(cfg, session, connection, preUpdateScriptPatches, false); // check scripts
|
||||||
|
checkSchemaPatchScripts(cfg, session, connection, postUpdateScriptPatches, false); // check scripts
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the flag indicating a running bootstrap
|
// Remove the flag indicating a running bootstrap
|
||||||
setBootstrapCompleted(connection);
|
setBootstrapCompleted(connection);
|
||||||
|
Reference in New Issue
Block a user