Class UniqueConstraintAddition
- java.lang.Object
-
- com.atlassian.confluence.internal.upgrade.constraint.UniqueConstraintAddition
-
public class UniqueConstraintAddition extends Object
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
Constructors Constructor Description UniqueConstraintAddition(String name, String table, List<String> uniqueColumns, String idColumn, DedupeStrategy strategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addIfMissing(ConstraintChecker constraintChecker, Deduper deduper, ConstraintCreator constraintCreator)
Add a required unique constraint if missing from the DBString
toString()
-
-
-
Method Detail
-
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
-
-