Assim como as Migrations no mundo Ruby On Rails, o mundo Java também possui diversas alternativas para evoluir o banco de dados de uma aplicação. Aprenda como você e sua equipe podem evoluir de maneira iterativa e incremental seu banco de dados (já em produção) durante a evolução da sua aplicação.
19. instalando MyBatis Migrations | download & unzip
[rponte]
~/Development/tools
$
unzip
mybatis-‐3.0.6-‐migrations.zip
[rponte]
~/Development/tools
$
ls
-‐l
mybatis-‐migrations-‐3.0.6
total
536
-‐rw-‐r-‐-‐r-‐-‐@
1
rponte
staff
11560
Oct
9
2011
LICENSE
-‐rw-‐r-‐-‐r-‐-‐@
1
rponte
staff
2051
Oct
9
2011
MIGRATIONS-‐README
-‐rw-‐r-‐-‐r-‐-‐@
1
rponte
staff
253003
Oct
9
2011
MyBatis-‐3-‐Migrations.pdf
-‐rw-‐r-‐-‐r-‐-‐@
1
rponte
staff
2519
Oct
9
2011
NOTICE
drwxrwxrwx
5
rponte
staff
170
May
11
02:45
bin
drwxrwxrwx
3
rponte
staff
102
Oct
9
2011
lib
Monday, May 14, 2012
20. instalando MyBatis Migrations | environment
[rponte]
~/Development/tools
$
export
PATH=$MIGRATIONS_HOME/bin:$PATH
[rponte]
~/Development/tools
$
migrate
-‐-‐help
Commands:
init
Creates
(if
necessary)
and
initializes
a
migration
path.
bootstrap
Runs
the
bootstrap
SQL
script
(see
scripts/bootstrap.sql
for
more).
new
<description>
Creates
a
new
migration
with
the
provided
description.
up
[n]
Run
unapplied
migrations,
ALL
by
default,
or
'n'
specified.
down
[n]
Undoes
migrations
applied
to
the
database.
ONE
by
default
or
'n'
specified.
version
<version>
Migrates
the
database
up
or
down
to
the
specified
version.
pending
Force
executes
pending
migrations
out
of
order
(not
recommended).
status
Prints
the
changelog
from
the
database
if
the
changelog
table
exists.
script
<v1>
<v2>
Generates
a
delta
migration
script
from
version
v1
to
v2
(undo
if
v1
>
v2).
Monday, May 14, 2012