/******************************************************************************/
/****              Generated by IBExpert 17/02/2022 17:03:55               ****/
/******************************************************************************/

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



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


CREATE GENERATOR GTBCONCILIACAO_CARTAO_PARC_AUX;

CREATE TABLE TBCONCILIACAO_CARTAO_PARC_AUX (
    ID                INTEGER NOT NULL,
    ADQUIRENTE_ID     INTEGER,
    CONTROLE_PARCELA  INTEGER,
    MERCHANT_ID       VARCHAR(50),
    DATA_EXPIRACAO    DATE,
    STATUS_BAIXA      VARCHAR(1) DEFAULT 1
);




/******************************************************************************/
/****                             Primary keys                             ****/
/******************************************************************************/

ALTER TABLE TBCONCILIACAO_CARTAO_PARC_AUX ADD CONSTRAINT PK_TBCONC_CARTAO_PARC_AUX PRIMARY KEY (ID);


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



SET TERM ^ ;



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



/* Trigger: TTBCONC_CARTAO_PARC_AUX_B01I */
CREATE OR ALTER TRIGGER TTBCONC_CARTAO_PARC_AUX_B01I FOR TBCONCILIACAO_CARTAO_PARC_AUX
ACTIVE BEFORE INSERT POSITION 0
as
begin
  if (new.id is null) then
    new.id = gen_id(GTBCONCILIACAO_CARTAO_PARC_AUX,1);
end
^

SET TERM ; ^