I am developing a spring boot app with hibernate an liquibase on a postsgre db. When i start the spring boot app, the changelog is updated in the db and the log says, that the script run successfully, but the table is still in the schema.
This is my db.changelog.xml:
<changeSet author="stimpson" id="deletetablehans">
<sqlFile dbms="postgre" encoding="UTF-8" endDelimiter=";"
path="sql/00003_deleteTableHans.sql" relativeToChangelogFile="true"
splitStatements="true" stripComments="true" />
</changeSet>
This is my script (deletetablehans.sql in the sql folder):
--liquibase formatted sql
--changeset stimpson:deleteTableHans
DROP TABLE HANS;
commit;
;
This is part of my logfile:
2021-01-25 15:43:50,438 INFO liquibase.lockservice : Changelog-Protokoll erfolgreich gesperrt.
2021-01-25 15:43:50,686 INFO liquibase.changelog : Reading from public.databasechangelog
2021-01-25 15:43:50,704 INFO liquibase.changelog : ChangeSet db/dbchangelog.xml::deletetablehans::stimpson ran successfully in 0ms
2021-01-25 15:43:50,709 INFO liquibase.lockservice : Successfully released change log lock
I do not care why the language changes, but when i look at the database, I see that the table named Hans is still there. But why? I did try with an explicit commit and the delimiter in its own line, but i do not understand the outcome?
This is my liquibase.properties file:
changeLogFile=src/main/resources/db/dbchangelog.xml
url=jdbc:postgresql://localhost:5432/padsyhw3
username=dbuser
password=dbpass
driver=org.postgresql.Driver
This is the only data row in the databasechangelog table in DB:
deletetablehans stimpson db/dbchangelog.xml 2021-01-25 15:49:05 1 EXECUTED 8:90e2fa99c6beeace580e429bd2bf9ae3 sqlFile 4.2.2
question from:
https://stackoverflow.com/questions/65887115/delete-table-in-database-using-liquibase-does-not-work 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…