CREATE TABLE TBFIREBIRD_ADMIN_PASTA (
    ID INTEGER,
    DESCRICAO VARCHAR(50));

CREATE SEQUENCE GTBFIREBIRD_ADMIN_PASTA;

SET TERM ^ ;

create trigger ttbfirebird_admin_pasta_b01i for tbfirebird_admin_pasta
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbfirebird_admin_pasta,1);
end
^

SET TERM ;

CREATE SEQUENCE GTBFIREBIRD_ADMIN_DB;

SET TERM ^ ;

create trigger ttbfirebird_admin_db_b01i for tbfirebird_admin_db
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbfirebird_admin_db,1);
end
^

SET TERM ;

CREATE TABLE TBFIREBIRD_ADMIN_SQL (
    ID INTEGER NOT NULL,
    USUARIO_ID INTEGER,
    SQL BLOB SUB_TYPE 1 SEGMENT SIZE 80,
    "LOG" BLOB SUB_TYPE 1 SEGMENT SIZE 80,
    DATA_HORA TIMESTAMP);

ALTER TABLE TBFIREBIRD_ADMIN_SQL
ADD CONSTRAINT PK_TBFIREBIRD_ADMIN_SQL
PRIMARY KEY (ID);

CREATE SEQUENCE GTBFIREBIRD_ADMIN_SQL;

SET TERM ^ ;

create trigger ttbfirebird_admin_sql_b01i for tbfirebird_admin_sql
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbfirebird_admin_sql,1);
end
^

SET TERM ;

COMMIT WORK;
