Class TableTransformingBaseConverter
- java.lang.Object
-
- jetbrains.buildServer.serverSide.versioning.converters.TableTransformingBaseConverter
-
- All Implemented Interfaces:
Converter
- Direct Known Subclasses:
AddScaleToBuildDataStorage
,ExpandGroupIdColumnConverter
,FixDuplicatesSchemaConverter
,NotificationRuleConverter
,PersonalModificationHashConverter
,PutInOrderVcsTablesConverter
,RefactorPersonalPromotionsConverter
,RefactorUserTablesConverter
,SimpleFixSomePrimaryKeysConverter
,UnicodeFields2021Converter
,UnicodeFieldsConverter
,VcsRootMappingChangeInternalIdTypeConverter
public abstract class TableTransformingBaseConverter extends Object implements Converter
Base class for converters that modifies table structures.- Since:
- 9.0
- Author:
- Leonid Bushuev from JetBrains
-
-
Field Summary
Fields Modifier and Type Field Description protected static List<TableKeyDef>
NO_KEYS
protected static String
SHADOW_SUFFIX
Suffix for shadow (temporary) tables.protected static Charset
UTF_8
-
Constructor Summary
Constructors Constructor Description TableTransformingBaseConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkAndRecoverTables(DBFunctions dbf, SchemaDef originSchema)
void
convert(DBFunctions dbf, File teamCityDataDir)
protected static void
copyTable(DBFunctions dbf, String srcName, String destName)
protected static void
copyTable(DBFunctions dbf, String srcName, String destName, String condition)
protected static void
copyTableConsideringLengths(DBFunctions dbf, String srcName, TableDef dest)
protected void
createAndPopulateShadowTables(DBFunctions dbf, SchemaDef shadowSchema)
protected void
createNewTables(DBFunctions dbf, SchemaDef originSchema)
protected void
dropOriginTables(DBFunctions dbf, SchemaDef originSchema)
protected static void
dropSchemaTables(DBFunctions dbf, SchemaDef shadowSchema)
protected void
dropShadowTables(DBFunctions dbf, SchemaDef shadowSchema)
protected String
getSchemaResourceFileName()
protected String
getShadowSuffix()
Suffix for shadow (temporary) tables.protected SchemaDef
loadNewSchema()
protected boolean
needsToPerformConverter(DBFunctions dbf)
protected SchemaDef
prepareShadowSchema(SchemaDef originSchema)
protected void
recoverTables(DBFunctions dbf, Collection<String> tablesToRecover)
-
-
-
Field Detail
-
SHADOW_SUFFIX
protected static final String SHADOW_SUFFIX
Suffix for shadow (temporary) tables.- See Also:
- Constant Field Values
-
NO_KEYS
protected static final List<TableKeyDef> NO_KEYS
-
UTF_8
protected static final Charset UTF_8
-
-
Method Detail
-
convert
public void convert(@NotNull DBFunctions dbf, @NotNull File teamCityDataDir) throws ConvertException
- Specified by:
convert
in interfaceConverter
teamCityDataDir
- - directory which contains- Throws:
ConvertException
-
needsToPerformConverter
protected boolean needsToPerformConverter(@NotNull DBFunctions dbf)
-
getSchemaResourceFileName
protected String getSchemaResourceFileName()
-
loadNewSchema
protected SchemaDef loadNewSchema()
-
checkAndRecoverTables
protected void checkAndRecoverTables(@NotNull DBFunctions dbf, @NotNull SchemaDef originSchema)
-
recoverTables
protected void recoverTables(@NotNull DBFunctions dbf, @NotNull Collection<String> tablesToRecover)
-
createAndPopulateShadowTables
protected void createAndPopulateShadowTables(@NotNull DBFunctions dbf, @NotNull SchemaDef shadowSchema)
-
createNewTables
protected void createNewTables(@NotNull DBFunctions dbf, @NotNull SchemaDef originSchema)
-
copyTable
protected static void copyTable(@NotNull DBFunctions dbf, @NotNull String srcName, @NotNull String destName, @Nullable String condition)
-
copyTable
protected static void copyTable(@NotNull DBFunctions dbf, @NotNull String srcName, @NotNull String destName)
-
copyTableConsideringLengths
protected static void copyTableConsideringLengths(@NotNull DBFunctions dbf, @NotNull String srcName, @NotNull TableDef dest)
-
dropOriginTables
protected void dropOriginTables(@NotNull DBFunctions dbf, @NotNull SchemaDef originSchema)
-
dropShadowTables
protected void dropShadowTables(@NotNull DBFunctions dbf, @NotNull SchemaDef shadowSchema)
-
dropSchemaTables
protected static void dropSchemaTables(@NotNull DBFunctions dbf, @NotNull SchemaDef shadowSchema)
-
getShadowSuffix
protected String getShadowSuffix()
Suffix for shadow (temporary) tables.
-
-