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

Don't check for migrations on Vitess yet #654

Merged
merged 1 commit into from Nov 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion misk-hibernate/src/main/kotlin/misk/hibernate/SchemaMigrator.kt
Expand Up @@ -2,12 +2,17 @@ package misk.hibernate

import com.google.common.base.Stopwatch
import misk.jdbc.DataSourceConfig
import misk.jdbc.DataSourceType
import misk.logging.getLogger
import misk.resources.ResourceLoader
import org.hibernate.SessionFactory
import org.hibernate.query.Query
import java.sql.Connection
import java.util.*
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we don't want to wildcard import right? Or do we alllow this in Kotlin?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, I think some folks don't have the same java import rules setup for Kotlin in IntelliJ (myself included until recently).

import java.util.Collections
import java.util.NavigableMap
import java.util.NavigableSet
import java.util.TreeMap
import java.util.TreeSet
import java.util.regex.Pattern
import javax.persistence.PersistenceException
import kotlin.reflect.KClass
Expand Down Expand Up @@ -113,6 +118,9 @@ internal class SchemaMigrator(

/** Throws an exception unless all available migrations have been applied. */
fun requireAll() {
if (config.type == DataSourceType.VITESS) {
logger.warn { "schema check currently not supported on Vitess" }
}
try {
val availableMigrations = availableMigrations()
val appliedMigrations = appliedMigrations()
Expand Down