UpdateDb issue with Oracle

I follow these steps: Configure db connection; Create new Entity; Generate Db script; Update database and then got this error:


[16:09:47.185] Trying to connect to jdbc:oracle:thin:@//crud.cgjd0tdq0q9k.us-west-2.rds.amazonaws.com:8080/fernbi
[16:09:49.406] Connection successful
[16:10:25.002] Updating database jdbc:oracle:thin:@//crud.cgjd0tdq0q9k.us-west-2.rds.amazonaws.com:8080/fernbi
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_3yg55td35qzwqwxclalmji8rk$_run_closure4.doCall(C:\Users\pentaho\studio-projects\seradmin\build.gradle:92)
:app-core:assembleDbScripts UP-TO-DATE
:app-core:updateDb FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app-core:updateDb'.
> java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.366 secs
[16:10:35.068] Task 'updateDb' failed
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

I sttoped the gradle (gradle --stop) and worked.

Now I am getting this error when updating database:


[16:25:24.531] Task 'updateDb' failed
org.gradle.api.UncheckedIOException: Failed to create parent directory 
'C:\Users\pentaho\studio-projects\seradmin\modules\core\build\db' 
when creating directory 
'C:\Users\pentaho\studio-projects\seradmin\modules\core\build\db\10-cuba'

I restarted CUBA studio and now I got:


 [16:37:25.365] Task 'updateDb' failed
java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (DW.SYS_C0012513) violated
I run select * from all_constraints
where
constraint_name = 'SYS_C0012513'; and this is related with SYS_DB_CHANGELOG table

Hi,

It is very hard to guess the reason of the error not having any details. Which messages were in Studio log before the error?

The SYS_DB_CHANGELOG table is used to register applied scripts. SCRIPT_NAME is the primary key in the table. So several DB-scripts should not have the same name. Please check scripts in your project and look whether the SYS_DB_CHANGELOG table already has rows(by some reason) with the same SCRIPT_NAME.

I deleted all the CUBA tables, then created them manually.

Then, I dont know how/why, it worked.