git-svn-id: https://svn.coded.pt/svn/SIPRP@614 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 18 years ago
parent b244b5210e
commit 9b03f62a00

@ -27,7 +27,7 @@ public class UpdateList
new Update[]{ new siprp.update.updates.V6_1_To_V7_0(), new siprp.update.updates.V7_0_To_V7_2(),
new siprp.update.updates.V7_2_To_V7_4(), new siprp.update.updates.V7_4_To_V7_5(),
new siprp.update.updates.V7_5_To_V7_6(), new siprp.update.updates.V7_6_To_V7_7(),
new siprp.update.updates.V7_7_To_V7_8() };
new siprp.update.updates.V7_7_To_V7_8(), new siprp.update.updates.V7_8_To_V7_9() };
protected static Executer EXECUTER;
protected static double version = -1;

@ -0,0 +1,83 @@
/*
* V7_8_To_V7_9.java
*
* Created on December 19, 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 fpalma
*/
public class V7_8_To_V7_9
implements siprp.update.Update
{
/**
* Creates a new instance of V7_8_To_V7_9
*/
public V7_8_To_V7_9()
{
}
public String []listChanges()
{
return new String[]{ "Alterar tabela dos estabelecimentos para ter prestadores por defeito"};
}
public double getStartVersion()
{
return 7.8;
}
public double getEndVersion()
{
return 7.9;
}
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 estabelecimentos ADD prestador_consulta_id INTEGER REFERENCES prestadores( id );" );
executer.executeQuery( update );
update =
new com.evolute.utils.sql.Update(
"ALTER TABLE estabelecimentos ADD prestador_ecds_id INTEGER REFERENCES prestadores( id );" );
executer.executeQuery( update );
update =
new com.evolute.utils.sql.Update(
"ALTER TABLE estabelecimentos ADD aux INT REFERENCES contactos(id);" );
executer.executeQuery( update );
update =
new com.evolute.utils.sql.Update(
"UPDATE estabelecimentos SET aux = CAST( contacto AS INTEGER);" );
executer.executeQuery( update );
update =
new com.evolute.utils.sql.Update(
"ALTER TABLE estabelecimentos RENAME contacto TO contacto_backup;" );
executer.executeQuery( update );
update =
new com.evolute.utils.sql.Update(
"ALTER TABLE estabelecimentos RENAME aux TO contacto_id;" );
executer.executeQuery( update );
}
public String toString()
{
return "v" + getStartVersion() + " para v" + getEndVersion();
}
}
Loading…
Cancel
Save