From 5c5dcb0974db3a67fd50b7b7dff60aa2616f80b0 Mon Sep 17 00:00:00 2001 From: Jocelyne Date: Wed, 24 Jan 2024 13:20:05 +0100 Subject: [PATCH] -modify KDoc for checkExcessiveIndices and make it public again -modify KDoc for checkExcessiveForeignKeyConstraints and make it public --- exposed-core/api/exposed-core.api | 2 ++ .../org/jetbrains/exposed/sql/SchemaUtils.kt | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/exposed-core/api/exposed-core.api b/exposed-core/api/exposed-core.api index 9c0952eb54..79bd5c1f40 100644 --- a/exposed-core/api/exposed-core.api +++ b/exposed-core/api/exposed-core.api @@ -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 diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt index ac0d95dfde..26f78947d7 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt @@ -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 { + fun checkExcessiveIndices(vararg tables: Table, withLogs: Boolean): List { val toDrop = HashSet() val excessiveIndices = @@ -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 { + fun checkExcessiveForeignKeyConstraints(vararg tables: Table, withLogs: Boolean): List { val toDrop = HashSet() val excessiveConstraints = currentDialect.columnConstraints(*tables).filter { (_, fkConstraints) -> fkConstraints.size > 1 }