Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Deprecate functions that should be replaced by migrations #2333

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ object SchemaUtils {
* to use a lock based on synchronization with a dummy table.
* @see SchemaUtils.withDataBaseLock
*/
@Deprecated(
"Execution of this function might lead to unpredictable state in the database if a failure occurs at any point. " +
"To prevent this, please use `MigrationUtils.statementsRequiredForDatabaseMigration` with a third-party migration tool (e.g., Flyway).",
ReplaceWith("MigrationUtils.statementsRequiredForDatabaseMigration"),
DeprecationLevel.WARNING
)
fun createMissingTablesAndColumns(vararg tables: Table, inBatch: Boolean = false, withLogs: Boolean = true) {
with(TransactionManager.current()) {
db.dialect.resetCaches()
Expand Down Expand Up @@ -631,6 +637,11 @@ object SchemaUtils {
* By default, a description for each intermediate step, as well as its execution time, is logged at the INFO level.
* This can be disabled by setting [withLogs] to `false`.
*/
@Deprecated(
"This function will be removed in future releases.",
ReplaceWith("MigrationUtils.statementsRequiredForDatabaseMigration"),
DeprecationLevel.WARNING
)
fun statementsRequiredToActualizeScheme(vararg tables: Table, withLogs: Boolean = true): List<String> {
val (tablesToCreate, tablesToAlter) = tables.partition { !it.exists() }
val createStatements = logTimeSpent("Preparing create tables statements", withLogs) {
Expand Down
Loading