/
info.html
259 lines (252 loc) · 10 KB
/
info.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
---
layout: maven
pill: info
subtitle: 'mvn flyway:info'
---
<div id="mavenGoalInfo">
<h1>Maven Goal: Info</h1>
<p>Prints the details and status information about all the migrations.</p>
<a href="/documentation/command/info"><img src="/assets/balsamiq/command-info.png" alt="info"></a>
<h2>Usage</h2>
<pre class="console">> mvn flyway:info</pre>
<h2>Configuration</h2>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>YES</td>
<td></td>
<td>The jdbc url to use to connect to the database</td>
</tr>
<tr>
<td>driver</td>
<td>NO</td>
<td><i>Auto-detected based on url</i></td>
<td>The fully qualified classname of the jdbc driver to use
to connect to the database
</td>
</tr>
<tr>
<td>serverId</td>
<td>NO</td>
<td>flyway-db</td>
<td>The id of the server in the Maven settings.xml file to
load the credentials from.<br/><br/>This is an alternative to passing the credentials in
directly through properties.
</td>
</tr>
<tr>
<td>user</td>
<td>NO</td>
<td></td>
<td>The user to use to connect to the database</td>
</tr>
<tr>
<td>password</td>
<td>NO</td>
<td></td>
<td>The password to use to connect to the database</td>
</tr>
<tr>
<td>schemas</td>
<td>NO</td>
<td><i>default schema of the connection</i></td>
<td>Case-sensitive list of schemas managed by Flyway.<br/>
The first schema will be the one containing the metadata table.
</td>
</tr>
<tr>
<td>table</td>
<td>NO</td>
<td>schema_version</td>
<td>The name of Flyway's metadata table.<br/>By
default (single-schema mode) the metadata table is placed in the default schema for the connection
provided by the datasource.<br/>When the <i>flyway.schemas</i> property is set (multi-schema mode),
the metadata table is placed in the first schema of the list.
</td>
</tr>
<tr>
<td>locations</td>
<td>NO</td>
<td>filesystem:src/main/resources/db/migration</td>
<td>Locations to scan recursively for migrations. The location type is determined by its prefix.<br/>
Unprefixed locations or locations starting with <code>classpath:</code> point to a package on the
classpath and may contain both sql and java-based migrations.<br/>
Locations starting with <code>filesystem:</code> point to a directory on the filesystem and may only
contain sql migrations.
</td>
</tr>
<tr>
<td>sqlMigrationPrefix</td>
<td>NO</td>
<td>V</td>
<td>The file name prefix for Sql migrations</td>
</tr>
<tr>
<td>repeatableSqlMigrationPrefix</td>
<td>NO</td>
<td>R</td>
<td>The file name prefix for repeatable Sql migrations</td>
</tr>
<tr>
<td>sqlMigrationSeparator</td>
<td>NO</td>
<td>__</td>
<td>The file name separator for Sql migrations</td>
</tr>
<tr>
<td>sqlMigrationSuffix</td>
<td>NO</td>
<td>.sql</td>
<td>The file name suffix for Sql migrations</td>
</tr>
<tr>
<td>encoding</td>
<td>NO</td>
<td>UTF-8</td>
<td>The encoding of Sql migrations</td>
</tr>
<tr>
<td>placeholderReplacement</td>
<td>NO</td>
<td>true</td>
<td>Whether placeholders should be replaced</td>
</tr>
<tr>
<td>placeholders</td>
<td>NO</td>
<td></td>
<td>Placeholders to replace in Sql migrations</td>
</tr>
<tr>
<td>placeholderPrefix</td>
<td>NO</td>
<td>${</td>
<td>The prefix of every placeholder </td>
</tr>
<tr>
<td>placeholderSuffix</td>
<td>NO</td>
<td>}</td>
<td>The suffix of every placeholder</td>
</tr>
<tr>
<td>resolvers</td>
<td>NO</td>
<td></td>
<td>Fully qualified class names of custom
<a href="/documentation/api/javadoc/org/flywaydb/core/api/resolver/MigrationResolver">MigrationResolver</a>
implementations to be used in addition to the built-in ones for resolving Migrations to apply.</td>
</tr>
<tr>
<td>callbacks</td>
<td>NO</td>
<td></td>
<td>Fully qualified class names of
<a href="/documentation/api/javadoc/org/flywaydb/core/api/callback/FlywayCallback">FlywayCallback</a>
implementations to use to hook into the Flyway lifecycle.</td>
</tr>
<tr>
<td>skipDefaultCallbacks</td>
<td>NO</td>
<td>false</td>
<td>Whether default built-in callbacks (sql) should be skipped. If true, only custom callbacks are used.</td>
</tr>
<tr>
<td>target</td>
<td>NO</td>
<td><i>latest version</i></td>
<td>The target version up to which Flyway should consider migrations. Migrations with a higher version number will be ignored. The special value <code>current</code> designates the current version of the schema.
</td>
</tr>
<tr>
<td>outOfOrder</td>
<td>NO</td>
<td>false</td>
<td>Allows migrations to be run "out of order".
<p>If you already have versions 1 and 3 applied, and now a version 2 is found,
it will be applied too instead of being ignored.</p>
</td>
</tr>
<tr>
<td>skip</td>
<td>NO</td>
<td>false</td>
<td>Skips the execution of the plugin for this module</td>
</tr>
<tr>
<td>configFile</td>
<td>NO</td>
<td>flyway.properties</td>
<td>Properties file from which to load the Flyway configuration. The names of the individual properties match the ones you would
use as Maven or System properties. The encoding of the file must be the same as the encoding defined with the
flyway.encoding property, which is UTF-8 by default. Relative paths are relative to the POM.</td>
</tr>
</tbody>
</table>
<h2>Sample configuration</h2>
<pre class="prettyprint"><configuration>
<driver>org.hsqldb.jdbcDriver</driver>
<url>jdbc:hsqldb:file:${project.build.directory}/db/flyway_sample;shutdown=true</url>
<user>SA</user>
<password>mySecretPwd</password>
<schemas>
<schema>schema1</schema>
<schema>schema2</schema>
<schema>schema3</schema>
</schemas>
<table>schema_history</table>
<locations>
<location>classpath:migrations1</location>
<location>migrations2</location>
<location>filesystem:/sql-migrations</location>
</locations>
<sqlMigrationPrefix>Migration-</sqlMigrationPrefix>
<repeatableSqlMigrationPrefix>RRR</repeatableSqlMigrationPrefix>
<sqlMigrationSeparator>__</sqlMigrationSeparator>
<sqlMigrationSuffix>-OK.sql</sqlMigrationSuffix>
<encoding>ISO-8859-1</encoding>
<placeholderReplacement>true</placeholderReplacement>
<placeholders>
<aplaceholder>value</aplaceholder>
<otherplaceholder>value123</otherplaceholder>
</placeholders>
<placeholderPrefix>#[</placeholderPrefix>
<placeholderSuffix>]</placeholderSuffix>
<resolvers>
<resolver>com.mycompany.project.CustomResolver</resolver>
<resolver>com.mycompany.project.AnotherResolver</resolver>
</resolvers>
<callbacks>
<callback>com.mycompany.project.CustomCallback</callback>
<callback>com.mycompany.project.AnotherCallback</callback>
</callbacks>
<skipDefaultCallbacks>false</skipDefaultCallbacks>
<target>1.1</target>
<outOfOrder>false</outOfOrder>
<skip>false</skip>
<configFile>myConfig.properties</configFile>
</configuration></pre>
<h2>Sample output</h2>
<pre class="console">> mvn flyway:info
[INFO] [flyway:info {execution: default-cli}]
[INFO] +-------------+------------------------+---------------------+---------+
[INFO] | Version | Description | Installed on | State |
[INFO] +-------------+------------------------+---------------------+---------+
[INFO] | 1 | Initial structure | 2012-11-13 15:37:41 | Success |
[INFO] | 1.1 | Populate table | 2012-11-13 15:37:41 | Success |
[INFO] | 1.2 | Another user | | Pending |
[INFO] | 1.3 | And his brother | | Pending |
[INFO] +-------------+------------------------+---------------------+---------+</pre>
<p class="next-steps">
<a class="btn btn-primary" href="/documentation/maven/validate">Maven: validate <i class="fa fa-arrow-right"></i></a>
</p>
</div>