Skip to content

Commit d763e8e

Browse files
authored
chore: Deprecate functions that should be replaced by migration functions (#2333)
1 parent ffa3eef commit d763e8e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/SchemaUtils.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,12 @@ object SchemaUtils {
594594
* to use a lock based on synchronization with a dummy table.
595595
* @see SchemaUtils.withDataBaseLock
596596
*/
597+
@Deprecated(
598+
"Execution of this function might lead to unpredictable state in the database if a failure occurs at any point. " +
599+
"To prevent this, please use `MigrationUtils.statementsRequiredForDatabaseMigration` with a third-party migration tool (e.g., Flyway).",
600+
ReplaceWith("MigrationUtils.statementsRequiredForDatabaseMigration"),
601+
DeprecationLevel.WARNING
602+
)
597603
fun createMissingTablesAndColumns(vararg tables: Table, inBatch: Boolean = false, withLogs: Boolean = true) {
598604
with(TransactionManager.current()) {
599605
db.dialect.resetCaches()
@@ -637,6 +643,11 @@ object SchemaUtils {
637643
* By default, a description for each intermediate step, as well as its execution time, is logged at the INFO level.
638644
* This can be disabled by setting [withLogs] to `false`.
639645
*/
646+
@Deprecated(
647+
"This function will be removed in future releases.",
648+
ReplaceWith("MigrationUtils.statementsRequiredForDatabaseMigration"),
649+
DeprecationLevel.WARNING
650+
)
640651
fun statementsRequiredToActualizeScheme(vararg tables: Table, withLogs: Boolean = true): List<String> {
641652
val (tablesToCreate, tablesToAlter) = tables.partition { !it.exists() }
642653
val createStatements = logTimeSpent("Preparing create tables statements", withLogs) {

0 commit comments

Comments
 (0)