KenjiOhtsuka / harmonica

Kotlin Database Migration Tool. This tool makes it really easy to create table, index, add columns, and so on, with Kotlin DSL.
MIT License
134 stars 17 forks source link

Tasks in jarmonica gradle plugin don't work anymore #153

Open sylux6 opened 4 years ago

sylux6 commented 4 years ago

Describe the bug jarmonicaUp, jarmonicaDown and jarmonicaVersion don't work anymore

To Reproduce Run task.

The following error is returned:

Exception in thread "main" java.lang.NoSuchMethodError: org.jetbrains.exposed.sql.Transaction.exec(Ljava/lang/String;)Lkotlin/Unit;
    at com.improve_future.harmonica.core.Connection.execute(Connection.kt:189)
    at com.improve_future.harmonica.core.Connection.<init>(Connection.kt:99)
    at com.improve_future.harmonica.task.JarmonicaTaskMain.createConnection(JarmonicaTaskMain.kt:40)
    at com.improve_future.harmonica.task.JarmonicaUpMain.main(JarmonicaUpMain.kt:34)

Kotlin 1.4.0 JDK 1.8

KenjiOhtsuka commented 4 years ago

@Sylux6 Sorry for inconvenience I will research it

viktorisacenko commented 4 years ago

Same problem. Something new about this issue?

KenjiOhtsuka commented 3 years ago

@viktorisacenko @Sylux6 I was so sorry, too busy to fix it. Today I will solve it.

KenjiOhtsuka commented 3 years ago

it looks very strange. In my environment, the migration succeeded.

 % ./gradlew jarmonicaUp
Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

> Task :jarmonicaUp
== [Start] Migrate up 20180714192339748 ==
Create Table: normal_table
Create Table: normal_table_for_add
Add column: normal_table_for_add integer_column
Add column: normal_table_for_add varchar_column
Add column: normal_table_for_add decimal_column
Add column: normal_table_for_add boolean_column
Add column: normal_table_for_add blob_column
Add column: normal_table_for_add date_column
Add column: normal_table_for_add time_column
Add column: normal_table_for_add date_time_column
Add column: normal_table_for_add timestamp_column
Add column: normal_table_for_add text_column
Add Index: normal_table integer_column
== [End] Migrate up 20180714192339748 ==
== [Start] Migrate up 20180714194338790 ==
Create Table: not_null_table
Create Table: not_null_table_for_add
Add column: not_null_table_for_add integer_column
Add column: not_null_table_for_add varchar_column
Add column: not_null_table_for_add decimal_column
Add column: not_null_table_for_add boolean_column
Add column: not_null_table_for_add blob_column
Add column: not_null_table_for_add date_column
Add column: not_null_table_for_add time_column
Add column: not_null_table_for_add date_tiem_column
Add column: not_null_table_for_add timestamp_column
Add column: not_null_table_for_add text_column
Add foreign key: not_null_table_for_add.integer_column - normal_table_for_add.id
== [End] Migrate up 20180714194338790 ==
== [Start] Migrate up 20180714194840311 ==
Create Table: default_table
Create Table: default_table_for_add
Add column: default_table_for_add integer_column
Add column: default_table_for_add varchar_column
Add column: default_table_for_add decimal_column
Add column: default_table_for_add boolean_column
Add column: default_table_for_add blob_column
Add column: default_table_for_add date_column_1
Add column: default_table_for_add date_column_2
Add column: default_table_for_add date_column_3
Add column: default_table_for_add time_column_1
Add column: default_table_for_add time_column_2
Add column: default_table_for_add time_column_3
Add column: default_table_for_add date_tiem_column_1
Add column: default_table_for_add date_time_column_2
Add column: default_table_for_add date_time_column_3
Add column: default_table_for_add timestamp_column_1
Add column: default_table_for_add timestamp_column_2
Add column: default_table_for_add timestamp_column_3
Add column: default_table_for_add text_column
== [End] Migrate up 20180714194840311 ==
== [Start] Migrate up 20180714203511949 ==
Create Table: other_table
Create Table: other_table_for_add
Add column: other_table_for_add integer_column
Add column: other_table_for_add varchar_column
Add column: other_table_for_add decimal_column
Add column: other_table_for_add boolean_column
Add column: other_table_for_add date_column
Add column: other_table_for_add time_column
Add column: other_table_for_add date_time_column
Add column: other_table_for_add timestamp_column
Add column: other_table_for_add text_column
== [End] Migrate up 20180714203511949 ==

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

I guess removing exposed library is the solution 🤔

KenjiOhtsuka commented 3 years ago

@viktorisacenko @Sylux6 Hello, I removed exposed library. Please try 2.0.0.

KenjiOhtsuka commented 3 years ago

@viktorisacenko @Sylux6 I will provide a project code. This, harmonica_test is the test project. I wish it is helpful.

sylux6 commented 3 years ago

@KenjiOhtsuka We cannot use Exposed in migration classes anymore ?

KenjiOhtsuka commented 3 years ago

@Sylux6 From harmonica, I removed exposed. But I think you can use Exposed if you add it to gradle.

KenjiOhtsuka commented 3 years ago

I removed exposed because it might conflict with the existing Exposed versions. I mean, when the user develops some product with harmonica and it includes Exposed library for the user's product, the Exposed version sometimes differs from the one in Harmonica.

I thought lang.NoSuchMethodError arose in such a situation so I removed exposed from Harmonica.

sylux6 commented 3 years ago

I'm trying to figure out how to be able to use Exposed api during harmonica migrations since it got removed from the dependencies.