forked from Coded/SIPRP
no message
git-svn-id: https://svn.coded.pt/svn/SIPRP@378 bb69d46d-e84e-40c8-a05a-06db0d6337410'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
parent
ba06d2cdce
commit
e3fe3e61ac
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* V7_6_To_V7_7.java
|
||||
*
|
||||
* Created on May 15, 2007, 3:12 PM
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package siprp.update.updates;
|
||||
|
||||
import com.evolute.utils.Singleton;
|
||||
import com.evolute.utils.db.DBManager;
|
||||
import com.evolute.utils.db.Executer;
|
||||
import com.evolute.utils.sql.Assignment;
|
||||
import com.evolute.utils.sql.Field;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author lflores
|
||||
*/
|
||||
public class V7_6_To_V7_7
|
||||
implements siprp.update.Update
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a new instance of V7_6_To_V7_7
|
||||
*/
|
||||
public V7_6_To_V7_7()
|
||||
{
|
||||
}
|
||||
|
||||
public String []listChanges()
|
||||
{
|
||||
return new String[]{ "Alterar tabela dos exames e criar tabela exames_portaria" };
|
||||
}
|
||||
|
||||
public double getStartVersion()
|
||||
{
|
||||
return 7.6;
|
||||
}
|
||||
|
||||
public double getEndVersion()
|
||||
{
|
||||
return 7.7;
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
throws Exception
|
||||
{
|
||||
DBManager dbm = ( DBManager ) Singleton.getInstance( Singleton.DEFAULT_DBMANAGER );
|
||||
Executer executer = dbm.getSharedExecuter();
|
||||
com.evolute.utils.sql.Update update =
|
||||
new com.evolute.utils.sql.Update(
|
||||
"ALTER TABLE exames ADD fo BYTEA;" );
|
||||
executer.executeQuery( update );
|
||||
update = new com.evolute.utils.sql.Update(
|
||||
"CREATE TABLE exames_portaria ( id SERIAL NOT NULL, portaria VARCHAR(255) NOT NULL, data_entrada TIMESTAMP DEFAULT CURRENT_TIME NOT NULL, PRIMARY KEY( id ) );" );
|
||||
executer.executeQuery( update );
|
||||
com.evolute.utils.sql.Insert insert =
|
||||
new com.evolute.utils.sql.Insert( "ficha_aptidao_portaria",
|
||||
new Assignment[]{ new Assignment( new Field( "portaria" ), "Portaria n. 299/2007, de 16 de Mar\u00e7o" ) } );
|
||||
executer.executeQuery( insert );
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "v" + getStartVersion() + " para v" + getEndVersion();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue