From 63655878f8b4c1b51cc9c50e12e13ab09ae9ce9e Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Thu, 13 Sep 2007 10:19:03 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@568 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../siprp/update/updates/V7_7_To_V7_8.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 trunk/SIPRPSoft/src/siprp/update/updates/V7_7_To_V7_8.java diff --git a/trunk/SIPRPSoft/src/siprp/update/updates/V7_7_To_V7_8.java b/trunk/SIPRPSoft/src/siprp/update/updates/V7_7_To_V7_8.java new file mode 100644 index 00000000..648a1182 --- /dev/null +++ b/trunk/SIPRPSoft/src/siprp/update/updates/V7_7_To_V7_8.java @@ -0,0 +1,68 @@ +/* + * V7_7_To_V7_8.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_7_To_V7_8 + implements siprp.update.Update +{ + + /** + * Creates a new instance of V7_7_To_V7_8 + */ + public V7_7_To_V7_8() + { + } + + public String []listChanges() + { + return new String[]{ "Alterar tabela das datas de exames para incluir o prestador", + "Alterar tabela das datas de consulta para incluir o prestador"}; + } + + public double getStartVersion() + { + return 7.7; + } + + public double getEndVersion() + { + return 7.8; + } + + 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 trabalhadores_ecds_datas ADD prestador_id INTEGER REFERENCES prestadores( id );" ); + executer.executeQuery( update ); + update = new com.evolute.utils.sql.Update( + "ALTER TABLE trabalhadores_consultas_datas ADD prestador_id INTEGER REFERENCES prestadores( id );" ); + executer.executeQuery( update ); + + } + + public String toString() + { + return "v" + getStartVersion() + " para v" + getEndVersion(); + } +}