-- Tables

/***** Object:  Table VCLib.T_COMMAND *****/
CREATE TABLE VCLib.T_COMMAND
(
    "commandid" uuid NOT NULL,
    "name" varchar(255) NOT NULL,
    "enabled" boolean NOT NULL,
    "isdefault" boolean NOT NULL,
    "commandappearance" integer NULL,
    "icon" varchar(255) NULL,
    "owner" uuid NULL,
    "type_" integer NOT NULL
);

-- Alters

ALTER TABLE VCLib.T_COMMAND ADD CONSTRAINT PK_T_COMMAND
PRIMARY KEY (CommandID);


ALTER TABLE VCLib.T_COMMAND ADD CONSTRAINT FK_T_ENTITIES_T_COMMAND_type_
FOREIGN KEY(type_) REFERENCES VCLib.T_ENTITIES (EntityID);

-- Tables

/***** Object:  Table VCLib.T_ROOT_COMMAND *****/
CREATE TABLE VCLib.T_ROOT_COMMAND
(
    "commandid" uuid NOT NULL,
    "clientmodules" uuid NULL
);

-- Alters

ALTER TABLE VCLib.T_ROOT_COMMAND ADD CONSTRAINT PK_T_ROOT_COMMAND
PRIMARY KEY (CommandID);

ALTER TABLE VCLib.T_ROOT_COMMAND ADD CONSTRAINT FK_T_COMMAND_T_ROOT_COMMAND_CommandID
FOREIGN KEY(CommandID) REFERENCES VCLib.T_COMMAND (CommandID);

ALTER TABLE VCLib.T_ROOT_COMMAND ADD CONSTRAINT FK_T_CLIENT_MODULES_T_ROOT_COMMAND_ClientModules
FOREIGN KEY(ClientModules) REFERENCES VCLib.T_CLIENT_MODULES (ClientModuleID);

ALTER TABLE VCLib.T_COMMAND ADD CONSTRAINT FK_T_ROOT_COMMAND_T_COMMAND_Owner
FOREIGN KEY(Owner) REFERENCES VCLib.T_ROOT_COMMAND (CommandID);

-- Tables

/***** Object:  Table VCLib.T_PROCESS_COMMAND *****/
CREATE TABLE VCLib.T_PROCESS_COMMAND
(
    "commandid" uuid NOT NULL,
    "purpose" integer NOT NULL,
    "processname" varchar(255) NOT NULL,
    "processinitializationlexem" varchar(255) NULL
);

-- Alters

ALTER TABLE VCLib.T_PROCESS_COMMAND ADD CONSTRAINT PK_T_PROCESS_COMMAND
PRIMARY KEY (CommandID);

ALTER TABLE VCLib.T_PROCESS_COMMAND ADD CONSTRAINT FK_T_COMMAND_T_PROCESS_COMMAND_CommandID
FOREIGN KEY(CommandID) REFERENCES VCLib.T_COMMAND (CommandID);

