diff --git a/trunk/alter_20070124.sql b/trunk/alter_20070124.sql index 162a74f5..0c2f9c4c 100644 --- a/trunk/alter_20070124.sql +++ b/trunk/alter_20070124.sql @@ -15,8 +15,6 @@ WITHOUT OIDS; ALTER TABLE ecd_oficial OWNER TO postgres; - - -- Table: prestadores -- DROP TABLE prestadores; @@ -42,3 +40,26 @@ CREATE TABLE prestadores ) WITHOUT OIDS; ALTER TABLE prestadores OWNER TO postgres; +alter table marcacoes_grupos_realizados +add marcacoes_trabalhador_estado_id int4 +references marcacoes_trabalhador_estados(id) +-- Table: marcacoes_trabalhador_estados + +-- DROP TABLE marcacoes_trabalhador_estados; + +CREATE TABLE marcacoes_trabalhador_estados +( + id serial NOT NULL, + data date, + estado int4, + marcacao_id int4, + CONSTRAINT marcacoes_trabalhador_estados_pkey PRIMARY KEY (id), + CONSTRAINT marcacoes_trabalhador_estados_marcacao_id_fkey FOREIGN KEY (marcacao_id) + REFERENCES marcacoes_trabalhador (id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITHOUT OIDS; +ALTER TABLE marcacoes_trabalhador_estados OWNER TO postgres; + +alter table marcacoes_grupos_realizados add marcacoes_trabalhador_estado_id int4 references marcacoes_trabalhador_estados(id); +