Skip to content

Commit

Permalink
-modify KDoc for checkExcessiveIndices and make it public again
Browse files Browse the repository at this point in the history
-modify KDoc for checkExcessiveForeignKeyConstraints and make it public
  • Loading branch information
joc-a committed Jan 24, 2024
1 parent 89319da commit 5c5dcb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions exposed-core/api/exposed-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,8 @@ public final class org/jetbrains/exposed/sql/SchemaUtils {
public final fun addMissingColumnsStatements ([Lorg/jetbrains/exposed/sql/Table;Z)Ljava/util/List;
public static synthetic fun addMissingColumnsStatements$default (Lorg/jetbrains/exposed/sql/SchemaUtils;[Lorg/jetbrains/exposed/sql/Table;ZILjava/lang/Object;)Ljava/util/List;
public final fun checkCycle ([Lorg/jetbrains/exposed/sql/Table;)Z
public final fun checkExcessiveForeignKeyConstraints ([Lorg/jetbrains/exposed/sql/Table;Z)Ljava/util/List;
public final fun checkExcessiveIndices ([Lorg/jetbrains/exposed/sql/Table;Z)Ljava/util/List;
public final fun checkMappingConsistence ([Lorg/jetbrains/exposed/sql/Table;Z)Ljava/util/List;
public static synthetic fun checkMappingConsistence$default (Lorg/jetbrains/exposed/sql/SchemaUtils;[Lorg/jetbrains/exposed/sql/Table;ZILjava/lang/Object;)Ljava/util/List;
public final fun create ([Lorg/jetbrains/exposed/sql/Table;Z)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,12 +531,13 @@ object SchemaUtils {
}

/**
* Checks all [tables] for any that have more than one defined index and logs the findings.
* Checks all [tables] for any that have more than one defined index and logs the findings. If found, this function
* also logs the SQL statements that can be used to drop these indices.
*
* If found, this function also logs and returns the SQL statements that can be used to drop these constraints.
* @return List of indices that are excessive and can be dropped.
*/
@Suppress("NestedBlockDepth")
private fun checkExcessiveIndices(vararg tables: Table, withLogs: Boolean): List<Index> {
fun checkExcessiveIndices(vararg tables: Table, withLogs: Boolean): List<Index> {
val toDrop = HashSet<Index>()

val excessiveIndices =
Expand Down Expand Up @@ -570,12 +571,13 @@ object SchemaUtils {
}

/**
* Checks all [tables] for any that have more than one defined foreign key constraint and logs the findings.
* Checks all [tables] for any that have more than one defined foreign key constraint and logs the findings. If
* found, this function also logs the SQL statements that can be used to drop these foreign key constraints.
*
* If found, this function also logs and returns the SQL statements that can be used to drop these constraints.
* @return List of foreign key constraints that are excessive and can be dropped.
*/
@Suppress("NestedBlockDepth")
private fun checkExcessiveForeignKeyConstraints(vararg tables: Table, withLogs: Boolean): List<ForeignKeyConstraint> {
fun checkExcessiveForeignKeyConstraints(vararg tables: Table, withLogs: Boolean): List<ForeignKeyConstraint> {
val toDrop = HashSet<ForeignKeyConstraint>()

val excessiveConstraints = currentDialect.columnConstraints(*tables).filter { (_, fkConstraints) -> fkConstraints.size > 1 }
Expand Down

0 comments on commit 5c5dcb0

Please sign in to comment.