
/***** Object:  Table [VCLib].[T_COMMAND] *****/
CREATE TABLE [VCLib].[T_COMMAND]
(
    [CommandID] uniqueidentifier NOT NULL,
    [Name] varchar(255) NOT NULL,
    [Enabled] bit NOT NULL,
    [IsDefault] bit NOT NULL,
    [CommandAppearance] int NULL,
    [Icon] varchar(255) NULL,
    [Owner] uniqueidentifier NULL,
    [type_] int NOT NULL
)
ON [PRIMARY]
GO

-- Alters

ALTER TABLE [VCLib].[T_COMMAND] ADD CONSTRAINT [PK_T_COMMAND]
PRIMARY KEY CLUSTERED ([CommandID]) ON [PRIMARY]
GO

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


-- Tables

/***** Object:  Table [VCLib].[T_ROOT_COMMAND] *****/
CREATE TABLE [VCLib].[T_ROOT_COMMAND]
(
    [CommandID] uniqueidentifier NOT NULL,
    [ClientModules] uniqueidentifier NULL
)
ON [PRIMARY]
GO

-- Alters

ALTER TABLE [VCLib].[T_ROOT_COMMAND] ADD CONSTRAINT [PK_T_ROOT_COMMAND]
PRIMARY KEY CLUSTERED ([CommandID]) ON [PRIMARY]
GO

ALTER TABLE [VCLib].[T_ROOT_COMMAND] ADD CONSTRAINT [FK_T_COMMAND_T_ROOT_COMMAND_CommandID]
FOREIGN KEY([CommandID]) REFERENCES [VCLib].[T_COMMAND] ([CommandID])
GO

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])
GO


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

-- Tables

/***** Object:  Table [VCLib].[T_PROCESS_COMMAND] *****/
CREATE TABLE [VCLib].[T_PROCESS_COMMAND]
(
    [CommandID] uniqueidentifier NOT NULL,
    [Purpose] int NOT NULL,
    [ProcessName] varchar(255) NOT NULL,
    [ProcessInitializationLexem] varchar(255) NULL
)
ON [PRIMARY]
GO

-- Alters

ALTER TABLE [VCLib].[T_PROCESS_COMMAND] ADD CONSTRAINT [PK_T_PROCESS_COMMAND]
PRIMARY KEY CLUSTERED ([CommandID]) ON [PRIMARY]
GO

ALTER TABLE [VCLib].[T_PROCESS_COMMAND] ADD CONSTRAINT [FK_T_COMMAND_T_PROCESS_COMMAND_CommandID]
FOREIGN KEY([CommandID]) REFERENCES [VCLib].[T_COMMAND] ([CommandID])
GO