Skip to content

Commit

Permalink
Force drop table before test
Browse files Browse the repository at this point in the history
  • Loading branch information
e5l committed Sep 4, 2023
1 parent 195b1e8 commit e790e91
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions exposed-core/api/exposed-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -3459,6 +3459,7 @@ public class org/jetbrains/exposed/sql/vendors/H2Dialect : org/jetbrains/exposed
public fun isAllowedAsColumnDefault (Lorg/jetbrains/exposed/sql/Expression;)Z
public final fun isSecondVersion ()Z
public fun modifyColumn (Lorg/jetbrains/exposed/sql/Column;Lorg/jetbrains/exposed/sql/ColumnDiff;)Ljava/util/List;
public fun toString ()Ljava/lang/String;
}

public final class org/jetbrains/exposed/sql/vendors/H2Dialect$Companion : org/jetbrains/exposed/sql/vendors/VendorDialect$DialectNameProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ internal object H2FunctionProvider : FunctionProvider() {
* H2 dialect implementation.
*/
open class H2Dialect : VendorDialect(dialectName, H2DataTypeProvider, H2FunctionProvider) {

override fun toString(): String = "H2Dialect[$dialectName, $h2Mode]"

internal enum class H2MajorVersion {
One, Two
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ class DefaultsTest : DatabaseTestsBase() {

@Test
fun testDefaults01() {
println("Start test")
val currentDT = CurrentDateTime
val nowExpression = object : Expression<LocalDateTime>() {
override fun toQueryBuilder(queryBuilder: QueryBuilder) = queryBuilder {
println("currentDialectTest = $currentDialectTest")
+when (val dialect = currentDialectTest) {
is OracleDialect -> "SYSDATE"
is SQLServerDialect -> "GETDATE()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ abstract class DatabaseTestsBase {
Assume.assumeFalse(testDB in excludeSettings)

withDb(testDB) {
try {
SchemaUtils.drop(*tables)
} catch (_: Throwable) {
}

SchemaUtils.create(*tables)
try {
statement(testDB)
Expand Down

0 comments on commit e790e91

Please sign in to comment.