CREATE TABLE TBGP_ETAPA_PMP (
    ID INTEGER NOT NULL,
    GP_ID INTEGER,
    DESCRICAO VARCHAR(200),
    STATUS INTEGER DEFAULT 1); 

ALTER TABLE TBGP_ETAPA_PMP
ADD CONSTRAINT PK_TBGP_ETAPA_PMP
PRIMARY KEY (ID);

COMMENT ON COLUMN TBGP_ETAPA_PMP.STATUS IS
'0 - INATIVO;
1 - ATIVO;';

CREATE SEQUENCE GTBGP_ETAPA_PMP;

create trigger ttbgp_etapa_pmp_b01i for tbgp_etapa_pmp
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbgp_etapa_pmp,1);
end;

CREATE INDEX ITBGP_ETAPA_PMP_01
ON TBGP_ETAPA_PMP (GP_ID);

