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.
SIPRP/trunk/siprp/update/updates/V7_0_To_V7_1.java

76 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 V7_0_To_V7_1
implements siprp.update.Update
{
/**
* Creates a new instance of V6_1_To_V7_0
*/
public V7_0_To_V7_1()
{
}
public String []listChanges()
{
return new String[]{ "Criar tabela dos processos" };
}
public double getStartVersion()
{
return 7.0;
}
public double getEndVersion()
{
return 7.1;
}
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 marcacoes_processo "
+ "( "
+ "id serial NOT NULL, "
+ "trabalhador_id int4 NOT NULL, "
+ "estado char(1) NOT NULL DEFAULT 'a'::bpchar, "
+ "data_inicio date, "
+ "data_fim date, "
+ "CONSTRAINT marcacoes_processo_pkey PRIMARY KEY (id), "
+ "CONSTRAINT marcacoes_processo_trabalhador_id_fkey FOREIGN KEY (trabalhador_id) "
+ "REFERENCES trabalhadores (id) MATCH SIMPLE "
+ "ON UPDATE NO ACTION ON DELETE NO ACTION "
+ ") "
+ "WITHOUT OIDS;" );
executer.executeQuery( update );
}
public String toString()
{
return "v7.0 para v7.1";
}
}