org.opencms.setup.update6to7.mysql
Class CmsUpdateDBProjectId

java.lang.Object
  extended by org.opencms.setup.update6to7.A_CmsUpdateDBPart
      extended by org.opencms.setup.update6to7.generic.CmsUpdateDBProjectId
          extended by org.opencms.setup.update6to7.mysql.CmsUpdateDBProjectId
All Implemented Interfaces:
I_CmsUpdateDBPart

public class CmsUpdateDBProjectId
extends CmsUpdateDBProjectId

This class updates the project ids from integer values to CmsUUIDs in all existing database tables.

It creates new UUIDs for each existing project and stores it into a temporary table.

For each table using a project id a new column for the UUID is added and the according data is transferred.

After that the original indexes and the column for the project id index is dropped and the new column with the project uuid becomes the primary key.

Author:
metzler

Field Summary
 
Fields inherited from class org.opencms.setup.update6to7.generic.CmsUpdateDBProjectId
COLUMN_PROJECT_ID, COLUMN_PROJECT_LASTMODIFIED, COLUMN_PROJECT_UUID, COLUMN_TEMP_PROJECT_UUID, HISTORY_PROJECTS_TABLE, QUERY_ADD_PRIMARY_KEY, QUERY_ADD_TEMP_UUID_COLUMN, QUERY_CREATE_HISTORY_PROJECTS_TABLE, QUERY_CREATE_TEMP_TABLE_UUIDS, QUERY_DESCRIBE_TABLE, QUERY_READ_MAX_PUBTAG, REPLACEMENT_COLUMN, REPLACEMENT_NEW_COLUMN, REPLACEMENT_OLDID, REPLACEMENT_PRIMARY_KEY, REPLACEMENT_TABLENAME, RESOURCE_TABLES, RESOURCES_TABLES_LIST, TABLES, TABLES_LIST, TEMP_UUID_COLUMN, TEMPORARY_TABLE_NAME
 
Fields inherited from class org.opencms.setup.update6to7.A_CmsUpdateDBPart
m_poolData, m_queries, QUERY_PROPERTIES_PREFIX
 
Constructor Summary
CmsUpdateDBProjectId()
          Constructor.
 
Method Summary
protected  void createHistProjectsTable(CmsSetupDb dbCon)
          Creates the CMS_HISTORY_PROJECTS table if it does not exist yet.
protected  void createTempTable(CmsSetupDb dbCon)
          Creates the temp table for project ids if it does not exist yet.
 
Methods inherited from class org.opencms.setup.update6to7.generic.CmsUpdateDBProjectId
addPrimaryKey, addUUIDColumnToTable, checkColumnTypeProjectId, getColumnProjectIdResourcePath, internalExecute, needsUpdating, transferDataToHistoryTable
 
Methods inherited from class org.opencms.setup.update6to7.A_CmsUpdateDBPart
execute, getDbInstance, getPoolData, isKeepHistory, loadQueryProperties, readQuery, setPoolData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsUpdateDBProjectId

public CmsUpdateDBProjectId()
                     throws java.io.IOException
Constructor.

Throws:
java.io.IOException - if the query properties cannot be read
Method Detail

createHistProjectsTable

protected void createHistProjectsTable(CmsSetupDb dbCon)
                                throws java.sql.SQLException
Creates the CMS_HISTORY_PROJECTS table if it does not exist yet.

Overrides:
createHistProjectsTable in class CmsUpdateDBProjectId
Parameters:
dbCon - the db connection interface
Throws:
java.sql.SQLException - if soemthing goes wrong

createTempTable

protected void createTempTable(CmsSetupDb dbCon)
                        throws java.sql.SQLException
Creates the temp table for project ids if it does not exist yet.

Overrides:
createTempTable in class CmsUpdateDBProjectId
Parameters:
dbCon - the db connection interface
Throws:
java.sql.SQLException - if soemthing goes wrong