forked from Coded/SIPRP
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							72 lines
						
					
					
						
							1.7 KiB
						
					
					
				
			
		
		
	
	
							72 lines
						
					
					
						
							1.7 KiB
						
					
					
				| /*
 | |
|  * 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 without time zone NOT NULL DEFAULT now(), PRIMARY KEY( id ) );" );
 | |
| 		executer.executeQuery( update );
 | |
| 		com.evolute.utils.sql.Insert insert = 
 | |
| 				new com.evolute.utils.sql.Insert( "exames_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();
 | |
| 	}
 | |
| }
 |