From cbe09d6aadc040f0c02fcaa498195bb704023e99 Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Sun, 13 May 2007 16:51:00 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@366 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/Main.java | 2 +- trunk/siprp/update/UpdateList.java | 2 +- trunk/siprp/update/updates/V7_4_To_V7_5.java | 73 ++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 trunk/siprp/update/updates/V7_4_To_V7_5.java diff --git a/trunk/siprp/Main.java b/trunk/siprp/Main.java index e067ec59..3111738b 100644 --- a/trunk/siprp/Main.java +++ b/trunk/siprp/Main.java @@ -22,7 +22,7 @@ import siprp.update.UpdateWindow; public class Main implements com.evolute.utils.ui.window.Connector { - public final static String SHST_VERSION = "7.4"; + public final static String SHST_VERSION = "7.5"; private final static ClassLoader classLoader = new EVUtilsImageLib().getClass().getClassLoader(); diff --git a/trunk/siprp/update/UpdateList.java b/trunk/siprp/update/UpdateList.java index e1280159..53f3113e 100644 --- a/trunk/siprp/update/UpdateList.java +++ b/trunk/siprp/update/UpdateList.java @@ -25,7 +25,7 @@ public class UpdateList { protected static final Update UPDATE_LIST[] = 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_2_To_V7_4(), new siprp.update.updates.V7_4_To_V7_5() }; protected static Executer EXECUTER; protected static double version = -1; diff --git a/trunk/siprp/update/updates/V7_4_To_V7_5.java b/trunk/siprp/update/updates/V7_4_To_V7_5.java new file mode 100644 index 00000000..792157d0 --- /dev/null +++ b/trunk/siprp/update/updates/V7_4_To_V7_5.java @@ -0,0 +1,73 @@ +/* + * V7_4_To_V7_5.java + * + * Created on 26 de Setembro de 2006, 11:48 + * + * To change this template, choose Tools | Template Manager + * and open the template in the editor. + */ + +package siprp.update.updates; + +import com.evolute.utils.*; +import com.evolute.utils.arrays.*; +import com.evolute.utils.db.*; +import com.evolute.utils.sql.*; + + +/** + * + * @author fpalma + */ +public class V7_4_To_V7_5 + implements siprp.update.Update +{ + + /** + * Creates a new instance of V7_4_To_V7_5 + */ + public V7_4_To_V7_5() + { + } + + public String []listChanges() + { + return new String[]{ "Ligar processo a ficha de aptid\u00e3o" }; + } + + public double getStartVersion() + { + return 7.4; + } + + public double getEndVersion() + { + return 7.5; + } + + 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( + "CREATE TABLE trabalhadores_fichas_aptidao" + +"(" + +" id serial," + +" processo_id int4," + +" exame_id int4," + +" CONSTRAINT trabalhadores_fichas_aptidao_pkey PRIMARY KEY (id)," + +" CONSTRAINT trabalhadores_fichas_aptidao_exame_id_fkey FOREIGN KEY (exame_id) REFERENCES exames (id) ON UPDATE RESTRICT ON DELETE RESTRICT," + +" CONSTRAINT trabalhadores_fichas_aptidao_processo_id_fkey FOREIGN KEY (processo_id) REFERENCES trabalhadores_processo (id) ON UPDATE RESTRICT ON DELETE RESTRICT" + +")" + +"WITHOUT OIDS;" + +"ALTER TABLE trabalhadores_fichas_aptidao OWNER TO postgres;" ); + executer.executeQuery( update ); + } + + public String toString() + { + return "v7.4 para v7.5"; + } +}