Class UniqueConstraintAddition
java.lang.Object
com.atlassian.confluence.internal.upgrade.constraint.UniqueConstraintAddition
Add a unique constraint if not exist. Duplicates will be cleaned if needed before the unique constraint can be added.
Note: all table and column names must not be quoted. The reason is RDBMS vendors treat identifier case sensitivity
differently so generally identifiers can only be quoted they have been created with quotes originally.
- Since:
- 7.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionUniqueConstraintAddition
(String name, String table, List<String> uniqueColumns, String idColumn, DedupeStrategy strategy) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addIfMissing
(ConstraintChecker constraintChecker, Deduper deduper, ConstraintCreator constraintCreator) Add a required unique constraint if missing from the DBtoString()
-
Constructor Details
-
UniqueConstraintAddition
-
-
Method Details
-
addIfMissing
public boolean addIfMissing(ConstraintChecker constraintChecker, Deduper deduper, ConstraintCreator constraintCreator) throws UpgradeException Add a required unique constraint if missing from the DB- Returns:
- true if the constraint has been added, false if it already exists
- Throws:
UpgradeException
-
toString
-