SET
SQL DIALECT 3;
SET NAMES NONE;
SET CLIENTLIB 'C:\Program Files\Firebird\Firebird25\DLL32\fbclient.dll';
CREATE DATABASE 'firma-server /3025:D:\tmp\Bla.FDB'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 16384
DEFAULT CHARACTER SET NONE COLLATION NONE;
/******************************************************************************/
/**** Domains ****/
/******************************************************************************/
CREATE DOMAIN ID AS
INTEGER
NOT NULL;
CREATE DOMAIN STRING30 AS
VARCHAR(30)
NOT NULL;
/******************************************************************************/
/**** Generators ****/
/******************************************************************************/
CREATE GENERATOR ID_GEN;
SET GENERATOR ID_GEN TO 99;
/******************************************************************************/
/**** Tables ****/
/******************************************************************************/
CREATE TABLE T_MASTER_DEVICE_TYPES (
ID ID,
F_DEVICE_TYPE_ID ID,
F_DEVICE_TYPE_STRING STRING30
);
INSERT INTO T_MASTER_DEVICE_TYPES (ID, F_DEVICE_TYPE_ID, F_DEVICE_TYPE_STRING) VALUES (1, 0, 'Blübbchen');
COMMIT WORK;
/******************************************************************************/
/**** Primary Keys ****/
/******************************************************************************/
ALTER TABLE T_MASTER_DEVICE_TYPES ADD CONSTRAINT PK_T_MASTER_DEVICE_TYPES_1 PRIMARY KEY (ID);
/******************************************************************************/
/**** Indices ****/
/******************************************************************************/
/******************************************************************************/
/**** Triggers ****/
/******************************************************************************/
SET TERM ^ ;
/******************************************************************************/
/**** Triggers for tables ****/
/******************************************************************************/
/* Trigger: T_MASTER_DEVICE_TYPES_BI */
CREATE OR ALTER TRIGGER T_MASTER_DEVICE_TYPES_BI FOR T_MASTER_DEVICE_TYPES
ACTIVE BEFORE INSERT POSITION 0
AS
begin
if (new.id is null) then
new.id = gen_id(id_gen,1);
end
^
SET TERM ; ^
COMMIT WORK;