From 4f6e980ab8ba3eced2bbd6519e7ffbc4bced8337 Mon Sep 17 00:00:00 2001 From: "j.goderbauer" <j.goderbauer@adito.de> Date: Fri, 15 Jun 2018 07:52:02 +0200 Subject: [PATCH] readme: add information about rollback --- others/db_changes/readme.adoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/others/db_changes/readme.adoc b/others/db_changes/readme.adoc index 77e2c63d62..fe12e5629e 100644 --- a/others/db_changes/readme.adoc +++ b/others/db_changes/readme.adoc @@ -22,14 +22,17 @@ The file `masterChangelog.xml` contains a list of all changes (well, in fact mor </databaseChangeLog> ---- -IMPORTANT: Keep in mind that the header-information can change, visit therefore the liquibase-website: http://www.liquibase.org Specific: the XML-format definition: http://www.liquibase.org/documentation/xml_format.html +TIP: Keep in mind that the header-information can change, visit therefore the liquibase-website: http://www.liquibase.org Specific: the XML-format definition: http://www.liquibase.org/documentation/xml_format.html So, thats where all our changes are located - but what about the changes _itself_? As you can think of, they're stored in files located in the folders `struct` for DDL-stuff like _create_, _alter_ etc. -and `data` for DML-stuff like _insert_, _update_ etc. +and `data` for DML-stuff like _insert_, _update_ etc. If you want to know what to do add in these files take a look at the official liquibase documentation for futher information how to fill these XML files: http://www.liquibase.org/documentation/index.html +IMPORTANT: Always remember that you might have to define some rollback-entries. + +This is e.g. not needed for create-entries but for others like insert. + So, whats about that `liquibase.properties` file? The file is needed to specify some data here, e.g. the driver-name, classpath (of the driver), jdbc-url, etc. You want to store these information there because otherwise you'd need to specify them on every call of liquibase. Not cool. @@ -42,7 +45,7 @@ Now you're ready to run commands like `liquibase update` in the `PROJECTHOME/oth * fill the file with changesets that will create a table * add `include`-tag in the `masterChangelog.xml` for the created file * create a new file in the data-foler; e.g. `demoData_FOOBAR.xml` -* fill the file with changesets that will insert data into the table +* fill the file with changesets that will insert data into the table and define *rollback-entries* * add `include`-tag in the `masterChangelog.xml` for the created file * to apply the changes simply run `liquibase update` @@ -72,7 +75,7 @@ What about unicode-columns like `NVARCHAR` or `NCLOB`?:: Simply define them in your changesets; This is something which is not completely verified: Maybe columns like `NCLOB` cause problems in some DBMS like _MS SQL Server_ What if i swtich between branches and want to switch between different database-states?:: - This is something that needs to be defined. Possible ways: roleback or recreate your database entirely + This is something that needs to be defined. Possible ways: rollback or recreate your database entirely Is it possible to write an update-changeset where I can use a preparedStatement in the where-clause?:: This needs to be analysed and (the result) added here. -- GitLab