/******************************************************************************/
/***               Generated by IBExpert 16/11/2023 08:55:51                ***/
/******************************************************************************/

/******************************************************************************/
/***      Following SET SQL DIALECT is just for the Database Comparer       ***/
/******************************************************************************/
SET SQL DIALECT 3;



/******************************************************************************/
/***                                 Tables                                 ***/
/******************************************************************************/

CREATE GENERATOR PQ_COSTUREIRAS;


CREATE TABLE COSTUREIRAS (
    ID            INTEGER NOT NULL,
    NOME          VARCHAR(150),
    CPFCNPJ	  VARCHAR(20),
    INATIVO       VARCHAR(5),	
    ENDERECO      VARCHAR(100),
    NRENDERECO    VARCHAR(20),
    COMPLEMENTO   VARCHAR(100),
    BAIRRO        VARCHAR(60),
    CIDADE        INT,
    UF            CHAR(2),
    CEP           VARCHAR(12),
    TELEFONE      VARCHAR(30),
    CELULAR       VARCHAR(30),
    EMAIL         VARCHAR(200),
    OBS           VARCHAR(500),
    CONTROLE      VARCHAR(30)
);




/******************************************************************************/
/***                              Primary Keys                              ***/
/******************************************************************************/

ALTER TABLE COSTUREIRAS ADD CONSTRAINT PK_COSTUREIRAS PRIMARY KEY (ID);


/******************************************************************************/
/***                                Triggers                                ***/
/******************************************************************************/


SET TERM ^ ;



/******************************************************************************/
/***                          Triggers for tables                           ***/
/******************************************************************************/



/* Trigger: INSCOSTUREIRAS */
CREATE OR ALTER TRIGGER INSCOSTUREIRAS FOR COSTUREIRAS
ACTIVE BEFORE INSERT POSITION 0
as 
begin 
   new.ID=gen_id(PQ_COSTUREIRAS,1);
end
^


SET TERM ; ^



/******************************************************************************/
/***                               Privileges                               ***/
/******************************************************************************/


