CREATE TABLE TBMENU_FAVORITO (
    ID             INTEGER NOT NULL PRIMARY KEY,
    USUARIO_ID     INTEGER NOT NULL,
    MENU_ID        INTEGER NOT NULL,
    TIPO           CHAR(1) DEFAULT '1'
);

CREATE SEQUENCE GTBMENU_FAVORITO;

CREATE OR ALTER TRIGGER TBMENU_FAVORITO_B01I FOR TBMENU_FAVORITO
ACTIVE BEFORE INSERT POSITION 0
as
begin
  if (new.id is null) then
    new.id = gen_id(GTBMENU_FAVORITO,1);
end;