HI ,
I am not able deploy ddl script using Liquibase.
my script contains
DROP TABLE test;
CREATE TABLE test
drop drop table test2;
create table test2;
if table exist it should drop and then create . Liquibase is failing to deploy the script
I saw error like
Caused by: java.sql.SQLSyntaxErrorException: ORA-02289: table does not exist
I know that the table does not exist go and create it , provided create table script .
Please help me how to proceed deployments
Thx
Ramesh
Thx
ramesh
I would suggest the following:
-
Create a changeset that contains the drop table statement. This changeset will have a precondition to check if the table exists. If exist, drop table. If not exist, mark the changset ran.
-
Create a changeset that contains the create table statement. This could also have a precondition, but that is probably not required because of the previous changeset.
You can find more information on using preconditions here:
https://docs.liquibase.com/concepts/advanced/preconditions.html