How to implement and execute liquibase?

2

How do I implant liquibase? and run it? I have projects in java and I use the oracle database.

This tool has the possibility to generate from the version file of the bank state, can generate in .SQL ??

Can you use this file to go back to an old version of the bank?

I look forward to returning.

    
asked by anonymous 08.09.2014 / 16:26

1 answer

2

There are several ways to use Liquibase in your projects. You can use the command line to generate XML from an SQL and vice versa, there are other formats like YAML, JSON, among others. In addition to the command line, there is also a Maven plugin to run during the build of project. And it also has CDI support that enables you to deploy directly to the application on the server .

Below is an example of the most common way to use Liquibase for DB versioning.

   <changeSet author="nome-author" id="meu-changeset-id-1">
        <createTable tableName="user">
            <column name="uuid" type="VARCHAR(255)">
                <constraints primaryKey="true" />
            </column>
            <column name="name" type="VARCHAR(255)">
                <constraints nullable="false" />
            </column>
            <column name="age" type="INT" />
        </createTable>
    </changeSet>

All other changes to the bank table are only added to a new "changeSet", allowing you to roolback at any time.

Note that it is not a query generation / translation tool. Liquibase is a powerful versioning framework.

    
08.09.2014 / 20:39