Closed itstannus closed 3 years ago
Try the troubleshooting section. (i.e. enable debugging)
If that doesn't give you a clue then you need to attach a full log to this ticket.
Thx.
@Ibrunn the troubleshooting section helped.
DEBUG 20:19:48.687 main liquibase.database> Not adjusting the auto commit mode; it is already false
basically I had to mention commit in postgresql.sql
CREATE SCHEMA IF NOT EXISTS ${spring.liquibase.default-schema};
COMMIT;
I'm guessing you must have explicitly turned off auto-commit? From what I know auto-commit is the default in JDBC, so perhaps you had/have something like this in your config? :
spring.datasource.hikari.auto-commit=false
This would explain it.
What I'm saying is that in general it should not be necessary to add commit statements in the SQL scripts that Pre-Liquibase uses regardless of database platform. However, whatever the auto-commit setting such commit in the SQL script will never hurt.
I'm glad you solved it.
Hey Ibrunn, yes you are right , the property mentioned does exist in my application :
spring.datasource.hikari.auto-commit=false
Thanks :)
Below is the log, the right file is picked up but when i check in the database the schema is not created. Log:
INFO 16:04:05.093 main n.l.s.preliquibase.PreLiquibase> PreLiquibase: Executing SQL script : URL [file:/home/tanvi/Documents/projects/om-order/om-order-service/target/classes/preliquibase/postgresql.sql]
postgresql.sql contents :
CREATE SCHEMA IF NOT EXISTS tanvi;
using :