ECRGoods.txt (3,991 bytes)
/******************************************************************************/
/*** Generated by IBExpert 11/11/2014 10:10:29 AM ***/
/******************************************************************************/
/******************************************************************************/
/*** Following SET SQL DIALECT is just for the Database Comparer ***/
/******************************************************************************/
SET SQL DIALECT 3;
/******************************************************************************/
/*** Tables ***/
/******************************************************************************/
CREATE GENERATOR ECRGOODS_ID;
CREATE TABLE ECRGOODS (
ID INTEGER NOT NULL,
GODSID INTEGER NOT NULL,
ECCRID INTEGER,
NAME1 VARCHAR(255),
NAME2 VARCHAR(255),
TYPQNT INTEGER DEFAULT 0 NOT NULL,
PROCNDS DOUBLE PRECISION DEFAULT 0.0 NOT NULL,
LASTEDIT TIMESTAMP DEFAULT Current_TimeStamp
);
/******************************************************************************/
/*** Primary Keys ***/
/******************************************************************************/
ALTER TABLE ECRGOODS ADD CONSTRAINT ECRGOODS_PK PRIMARY KEY (ID);
/******************************************************************************/
/*** Foreign Keys ***/
/******************************************************************************/
ALTER TABLE ECRGOODS ADD CONSTRAINT ECRGOODS_ECCRID FOREIGN KEY (ECCRID) REFERENCES SYSCONST (ID);
ALTER TABLE ECRGOODS ADD CONSTRAINT ECRGOODS_GODSID FOREIGN KEY (GODSID) REFERENCES GOODS (ID);
/******************************************************************************/
/*** Triggers ***/
/******************************************************************************/
SET TERM ^ ;
/******************************************************************************/
/*** Triggers for tables ***/
/******************************************************************************/
/* Trigger: ECRGOODS_BI0 */
CREATE OR ALTER TRIGGER ECRGOODS_BI0 FOR ECRGOODS
ACTIVE BEFORE INSERT POSITION 0
AS
begin
if (New.ID is null) then New.ID = Gen_ID(ECRGoods_ID, 1);
end
^
SET TERM ; ^
/******************************************************************************/
/*** Descriptions ***/
/******************************************************************************/
COMMENT ON TABLE ECRGOODS IS
'������������ ������������ ������� �� ���.';
/******************************************************************************/
/*** Fields descriptions ***/
/******************************************************************************/
COMMENT ON COLUMN ECRGOODS.ID IS
'�������� ��� ������
��� (�������) �������� � ���� ���';
COMMENT ON COLUMN ECRGOODS.GODSID IS
'����� �� ����������� ������������ ������ � ���������� (GOODS)';
COMMENT ON COLUMN ECRGOODS.NAME1 IS
'������ ���� ����������� ������';
COMMENT ON COLUMN ECRGOODS.NAME2 IS
'���������� ����������� ������';
COMMENT ON COLUMN ECRGOODS.TYPQNT IS
'������� ���������:
0 - �������
1 - �����';
COMMENT ON COLUMN ECRGOODS.PROCNDS IS
'������ ��� (%)';
/******************************************************************************/
/*** Privileges ***/
/******************************************************************************/