CREATE TABLE IF NOT EXISTS vclib.T_ENTITIES_ATTRIBUTES
(
	EntitiesAttributesId varchar(255),
	EntityID int NOT NULL,
	Index int NOT NULL,
	AttributeType int NOT NULL,
	Name text NOT NULL,
	Description text NOT NULL,
	SystemType text NULL,
	MaxLength int NULL,
	Precision int NULL,
	Scale int NULL,
	DefaultFormat text NULL,
	IsCalculated boolean NOT NULL,
	IsFlag boolean NOT NULL,
	IsRequired boolean NOT NULL,
	MappingType int NULL,
	MappingName text NULL,
	IsStored boolean NOT NULL,
	Save boolean NOT NULL,
	LinkAttributeName text NULL,
	ChoiceAttributeData text NULL,
	AttrLexem text NULL,
	PathsAttributes text NULL,
	IsCashed boolean NOT NULL,
	CONSTRAINT PK_T_ENTITIES_ATTRIBUTES PRIMARY KEY (EntitiesAttributesId)
)
WITH (OIDS=FALSE);

CREATE INDEX IF NOT EXISTS IX_Ent_Attrs_EntityId_Index ON vclib.T_ENTITIES_ATTRIBUTES USING BTree (EntityId, Index);