Top Banner
Migrations for Java EVOLUINDO SEU BANCO DE MANEIRA INCREMENTAL Monday, May 14, 2012
29

Migrations for Java

Jun 06, 2015

Download

Technology

Rafael Ponte

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Migrations for Java

Migrations for JavaEVOLUINDO SEU BANCO DE MANEIRA INCREMENTAL

Monday, May 14, 2012

Page 2: Migrations for Java

Como você evolui sua

APP?

Monday, May 14, 2012

Page 3: Migrations for Java

Como você evolui seu

BANCO?

Monday, May 14, 2012

Page 4: Migrations for Java

Como você evolui seu

BANCO?

gerencia mudanças

Monday, May 14, 2012

Page 5: Migrations for Java

PREPARA UM HUGE_SCRIPT.SQL E APLICA MANUALMENTE?

Monday, May 14, 2012

Page 6: Migrations for Java

DEIXA NA MÃO DO DBA?

Monday, May 14, 2012

Page 7: Migrations for Java

DEIXA NA MÃO DO

ARQUITETO?

* BDUF (Big Design Up Front)

*

Monday, May 14, 2012

Page 8: Migrations for Java

CRIA SUA PRÓPRIA

FERRAMENTA, CERTO?

NÓS ♥ TECNOLOGIA CASEIRA

Monday, May 14, 2012

Page 9: Migrations for Java

Não importa qual solução você utilize...

Monday, May 14, 2012

Page 10: Migrations for Java

CADA SOLUÇÃOTEM VANTAGENS

E DESVANTAGENS

Monday, May 14, 2012

Page 11: Migrations for Java

CADA SOLUÇÃOTEM SEUS PRÓS

E CONTRAS

Monday, May 14, 2012

Page 12: Migrations for Java

A COMUNIDADE RUBYONRAILS APRENDEU DESDE O COMEÇO

Monday, May 14, 2012

Page 13: Migrations for Java

SIMPLES E EFICAZ:

MIGRATIONSMonday, May 14, 2012

Page 14: Migrations for Java

A COMUNIDADE JAVAPARECE QUE NÃO APRENDEUAINDA COMO SE FAZ

Monday, May 14, 2012

Page 15: Migrations for Java

Java ferramentas para todos os gostos

Monday, May 14, 2012

Page 16: Migrations for Java

Java ferramentas para todos os gostos

mybatis

Monday, May 14, 2012

Page 17: Migrations for Java

MyBatis Schema Migrations

Monday, May 14, 2012

Page 18: Migrations for Java

INSTALAÇÃO É SIMPLES

Monday, May 14, 2012

Page 19: Migrations for Java

[rponte]  ~/Development/tools$  unzip  mybatis-­‐3.0.6-­‐migrations.zip    

instalando MyBatis Migrations | download & unzip

[rponte]  ~/Development/tools$  ls  -­‐l  mybatis-­‐migrations-­‐3.0.6total  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  NOTICEdrwxrwxrwx    5  rponte    staff          170  May  11  02:45  bindrwxrwxrwx    3  rponte    staff          102  Oct    9    2011  lib

Monday, May 14, 2012

Page 20: Migrations for Java

[rponte]  ~/Development/tools$  export  PATH=$MIGRATIONS_HOME/bin:$PATH    

instalando MyBatis Migrations | environment

[rponte]  ~/Development/tools$  migrate  -­‐-­‐helpCommands:    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

Page 21: Migrations for Java

instalando MyBatis Migrations | project[rponte]  ~/Development/blog_project/db$  migrate  init

Monday, May 14, 2012

Page 22: Migrations for Java

MyBatis Migrations em ação...

Monday, May 14, 2012

Page 23: Migrations for Java

PODEMOS FACILITARE FOI O QUE FIZEMOS

ANT SCRIPT

Monday, May 14, 2012

Page 24: Migrations for Java

Monday, May 14, 2012

Page 25: Migrations for Java

Mybatis-Migrations-Anttasks github.com/triadworks/labs

Monday, May 14, 2012

Page 26: Migrations for Java

Mybatis-Migrations-Anttasks github.com/triadworks/labs

Monday, May 14, 2012

Page 27: Migrations for Java

Monday, May 14, 2012

Page 28: Migrations for Java

MyBatis Migrations Ant-tasks em

ação...Monday, May 14, 2012