Wednesday, April 4, 2012

Ant Task: Init

Ant Task: Init

 

Creates and initializes the metadata table in the schema.

Usage:

 

<flyway:init />

Configuration:


Driver = flyway.driver: The fully qualified classname of the jdbc driver to use to connect to the database , Required=YES,

URL = flyway.url: The jdbc url to use to connect to the database,

User = flyway.user: The user to use to connect to the database,

Password = flyway.password: The password to use to connect to the database, Required=NO, Default       Value=blank,

Schemas = flyway.schemas: Comma-separated list of schemas managed by Flyway. The first schema in the list will be the one containing the metadata table,Required=NO, Default Value= default schema of the connection,

Table =  flyway.table: The name of Flyway's metadata table.By default (single-schema mode) the metadata table is placed in the default schema for the connection provided by the     datasource.When the flyway.schemas property is set (multi-schema mode), the metadata table is placed in the first schema of the list,Required=No,Default Value = schema_version,

InitialVersion = flyway.initialVersion: The initial version to put in the database, Required=NO, Default Value=0,

InitialDescription = flyway.initialDescription: The description of the initial version, Required=NO, Default Value=<< Flyway Init >>,

ClassPath = flyway.classpath: The Ant classpath used to load the JDBC driver and the migrations, Required=NO,

ClassPathref = flyway.classpathref: The Ant classpath reference used to load the JDBC driver and the migrations, Required=NO.

Sample configuration;


<property name="flyway.driver" value="org.hsqldb.jdbcDriver"/>
<property name="flyway.url" value="jdbc:hsqldb:file:/db/flyway_sample"/>
<property name="flyway.user" value="SA"/>
<property name="flyway.password" value="mySecretPwd"/>
<property name="flyway.schemas" value="schema1,schema2,schema3"/>
<property name="flyway.table" value="schema_history"/>
<property name="flyway.initialVersion" value="1.0"/>
<property name="flyway.initialDescription" value="Base Migration"/>


Sample output

 

 

No comments:

Popular Posts