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.
		
		
		
		
		
			
		
			
				
					
					
						
							69 lines
						
					
					
						
							1.6 KiB
						
					
					
				
			
		
		
	
	
							69 lines
						
					
					
						
							1.6 KiB
						
					
					
				/*
 | 
						|
 * V6_1_To_V7_0.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 V6_1_To_V7_0 
 | 
						|
		implements siprp.update.Update
 | 
						|
{
 | 
						|
	
 | 
						|
	/**
 | 
						|
	 * Creates a new instance of V6_1_To_V7_0
 | 
						|
	 */
 | 
						|
	public V6_1_To_V7_0()
 | 
						|
	{
 | 
						|
	}
 | 
						|
	
 | 
						|
	public String []listChanges()
 | 
						|
	{
 | 
						|
		return new String[]{ "Acrescentar campo de contribuinte nos prestadores", 
 | 
						|
								"Acrescentar campo de prestador nas marca\u00e7\u00f5es",
 | 
						|
								"Acrescentar campo de prestador no hist\u00f3rico das  marca\u00e7\u00f5es"};
 | 
						|
	}
 | 
						|
	
 | 
						|
	public double getStartVersion()
 | 
						|
	{
 | 
						|
		return 6.1;
 | 
						|
	}
 | 
						|
	
 | 
						|
	public double getEndVersion()
 | 
						|
	{
 | 
						|
		return 7.0;
 | 
						|
	}
 | 
						|
	
 | 
						|
	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 prestadores ADD contribuinte VARCHAR(64);" );
 | 
						|
		executer.executeQuery( update );
 | 
						|
		update = new com.evolute.utils.sql.Update( "ALTER TABLE marcacoes_trabalhador ADD prestador_id int4 REFERENCES prestadores( id );" );
 | 
						|
		executer.executeQuery( update );
 | 
						|
		update = new com.evolute.utils.sql.Update( "ALTER TABLE marcacoes_trabalhador_estados ADD prestador_id int4 REFERENCES prestadores( id );" );
 | 
						|
		executer.executeQuery( update );
 | 
						|
	}
 | 
						|
	
 | 
						|
	public String toString()
 | 
						|
	{
 | 
						|
		return "v6.1 para v7.0";
 | 
						|
	}
 | 
						|
}
 |