Index: branches/ClientUserManagement/HeuristicLab.Services.Access.DataAccess/3.3/SQL Scripts/Initialize ClientManagement.sql
===================================================================
--- branches/ClientUserManagement/HeuristicLab.Services.Access.DataAccess/3.3/SQL Scripts/Initialize ClientManagement.sql	(revision 6820)
+++ branches/ClientUserManagement/HeuristicLab.Services.Access.DataAccess/3.3/SQL Scripts/Initialize ClientManagement.sql	(revision 6825)
@@ -2,5 +2,5 @@
 GO
 
-/****** Object:  Table [dbo].[Resource]    Script Date: 09/22/2011 12:53:30 ******/
+/****** Object:  Table [dbo].[Resource]    Script Date: 09/23/2011 17:55:12 ******/
 SET ANSI_NULLS ON
 GO
@@ -16,10 +16,11 @@
 	[ProcessorType] [nvarchar](max) NULL,
 	[NumberOfCores] [int] NULL,
-	[IPAddress] [nvarchar](max) NULL,
 	[MemorySize] [int] NULL,
-	[OperatingSystem] [nvarchar](max) NULL,
-	[Country] [nvarchar](max) NULL,
+	[OperatingSystem] [uniqueidentifier] NULL,
+	[Country] [uniqueidentifier] NULL,
 	[HeuristicLabVersion] [nvarchar](max) NULL,
-	[ClientType] [nvarchar](max) NULL,
+	[ClientType] [uniqueidentifier] NULL,
+	[ClientConfiguration] [uniqueidentifier] NULL,
+	[Timestamp] [datetime] NULL,
  CONSTRAINT [PK_Resource] PRIMARY KEY CLUSTERED 
 (
@@ -29,5 +30,38 @@
 
 GO
-/****** Object:  Table [dbo].[ResourceResourceGroup]    Script Date: 09/22/2011 12:53:47 ******/
+
+ALTER TABLE [dbo].[Resource]  WITH CHECK ADD  CONSTRAINT [FK_Resource_ClientConfiguration] FOREIGN KEY([ClientConfiguration])
+REFERENCES [dbo].[ClientConfiguration] ([Id])
+GO
+
+ALTER TABLE [dbo].[Resource] CHECK CONSTRAINT [FK_Resource_ClientConfiguration]
+GO
+
+ALTER TABLE [dbo].[Resource]  WITH CHECK ADD  CONSTRAINT [FK_Resource_ClientType] FOREIGN KEY([ClientType])
+REFERENCES [dbo].[ClientType] ([Id])
+GO
+
+ALTER TABLE [dbo].[Resource] CHECK CONSTRAINT [FK_Resource_ClientType]
+GO
+
+ALTER TABLE [dbo].[Resource]  WITH CHECK ADD  CONSTRAINT [FK_Resource_Country] FOREIGN KEY([Country])
+REFERENCES [dbo].[Country] ([Id])
+GO
+
+ALTER TABLE [dbo].[Resource] CHECK CONSTRAINT [FK_Resource_Country]
+GO
+
+ALTER TABLE [dbo].[Resource]  WITH CHECK ADD  CONSTRAINT [FK_Resource_OperatingSystem] FOREIGN KEY([OperatingSystem])
+REFERENCES [dbo].[OperatingSystem] ([Id])
+GO
+
+ALTER TABLE [dbo].[Resource] CHECK CONSTRAINT [FK_Resource_OperatingSystem]
+GO
+
+ALTER TABLE [dbo].[Resource] ADD  CONSTRAINT [DF_Resource_Id]  DEFAULT (newsequentialid()) FOR [Id]
+GO
+
+
+/****** Object:  Table [dbo].[ResourceResourceGroup]    Script Date: 09/23/2011 13:34:10 ******/
 SET ANSI_NULLS ON
 GO
@@ -60,6 +94,177 @@
 
 ALTER TABLE [dbo].[ResourceResourceGroup] CHECK CONSTRAINT [FK_ResourceResourceGroup_ResourceId]
-
-/****** Object:  Table [dbo].[ClientLog]    Script Date: 09/22/2011 12:54:07 ******/
+GO
+
+
+/****** Object:  Table [dbo].[Plugin]    Script Date: 09/23/2011 13:34:39 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[Plugin](
+	[Id] [uniqueidentifier] NOT NULL,
+	[Name] [nvarchar](max) NOT NULL,
+	[StrongName] [nvarchar](max) NULL,
+	[Version] [nvarchar](20) NOT NULL,
+ CONSTRAINT [PK_Plugin] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+/****** Object:  Table [dbo].[ResourcePlugin]    Script Date: 09/23/2011 13:34:53 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[ResourcePlugin](
+	[ResourceId] [uniqueidentifier] NOT NULL,
+	[PluginId] [uniqueidentifier] NOT NULL,
+ CONSTRAINT [PK_ResourcePlugin] PRIMARY KEY CLUSTERED 
+(
+	[ResourceId] ASC,
+	[PluginId] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+ALTER TABLE [dbo].[ResourcePlugin]  WITH CHECK ADD  CONSTRAINT [FK_ResourcePlugin_Plugin] FOREIGN KEY([PluginId])
+REFERENCES [dbo].[Plugin] ([Id])
+GO
+
+ALTER TABLE [dbo].[ResourcePlugin] CHECK CONSTRAINT [FK_ResourcePlugin_Plugin]
+GO
+
+ALTER TABLE [dbo].[ResourcePlugin]  WITH CHECK ADD  CONSTRAINT [FK_ResourcePlugin_Resource] FOREIGN KEY([ResourceId])
+REFERENCES [dbo].[Resource] ([Id])
+GO
+
+ALTER TABLE [dbo].[ResourcePlugin] CHECK CONSTRAINT [FK_ResourcePlugin_Resource]
+GO
+
+
+/****** Object:  Table [dbo].[UserGroup]    Script Date: 09/23/2011 13:35:16 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[UserGroup](
+	[Id] [uniqueidentifier] NOT NULL,
+	[FullName] [nvarchar](max) NULL,
+	[Name] [nvarchar](max) NULL,
+	[Type] [nvarchar](10) NOT NULL,
+ CONSTRAINT [PK_UserGroup] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+
+
+/****** Object:  Table [dbo].[UserGroupUserGroup]    Script Date: 09/23/2011 14:24:45 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[UserGroupUserGroup](
+	[UserGroupId] [uniqueidentifier] NOT NULL,
+	[UserGroupUserGroupId] [uniqueidentifier] NOT NULL,
+ CONSTRAINT [PK_UserGroupUserGroup] PRIMARY KEY CLUSTERED 
+(
+	[UserGroupId] ASC,
+	[UserGroupUserGroupId] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+ALTER TABLE [dbo].[UserGroupUserGroup]  WITH CHECK ADD  CONSTRAINT [FK_UserGroupUserGroup_UserGroup] FOREIGN KEY([UserGroupId])
+REFERENCES [dbo].[UserGroup] ([Id])
+GO
+
+ALTER TABLE [dbo].[UserGroupUserGroup] CHECK CONSTRAINT [FK_UserGroupUserGroup_UserGroup]
+GO
+
+ALTER TABLE [dbo].[UserGroupUserGroup]  WITH CHECK ADD  CONSTRAINT [FK_UserGroupUserGroup_UserGroup1] FOREIGN KEY([UserGroupUserGroupId])
+REFERENCES [dbo].[UserGroup] ([Id])
+GO
+
+ALTER TABLE [dbo].[UserGroupUserGroup] CHECK CONSTRAINT [FK_UserGroupUserGroup_UserGroup1]
+GO
+
+
+
+
+/****** Object:  Table [dbo].[OperatingSystem]    Script Date: 09/23/2011 13:36:01 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[OperatingSystem](
+	[Id] [uniqueidentifier] NOT NULL,
+	[Name] [nvarchar](max) NOT NULL,
+ CONSTRAINT [PK_OperatingSystem] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+
+
+/****** Object:  Table [dbo].[Country]    Script Date: 09/23/2011 13:36:11 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[Country](
+	[Id] [uniqueidentifier] NOT NULL,
+	[Name] [nvarchar](max) NOT NULL,
+ CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+
+/****** Object:  Table [dbo].[ClientType]    Script Date: 09/23/2011 13:36:24 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[ClientType](
+	[Id] [uniqueidentifier] NOT NULL,
+	[Name] [nvarchar](max) NOT NULL,
+ CONSTRAINT [PK_ClientType] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+/****** Object:  Table [dbo].[ClientLog]    Script Date: 09/23/2011 13:36:35 ******/
 SET ANSI_NULLS ON
 GO
@@ -72,5 +277,4 @@
 	[ResourceId] [uniqueidentifier] NOT NULL,
 	[Message] [nvarchar](max) NULL,
-	[Exception] [nvarchar](max) NULL,
  CONSTRAINT [PK_ClientLog] PRIMARY KEY CLUSTERED 
 (
@@ -89,71 +293,60 @@
 GO
 
-/****** Object:  Table [dbo].[User]    Script Date: 09/22/2011 12:54:23 ******/
-SET ANSI_NULLS ON
-GO
-
-SET QUOTED_IDENTIFIER ON
-GO
-
-CREATE TABLE [dbo].[User](
-	[Id] [uniqueidentifier] NOT NULL,
-	[FullName] [nvarchar](max) NULL,
- CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
-(
-	[Id] ASC
-)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
-) ON [PRIMARY]
-
-GO
-
-/****** Object:  Table [dbo].[UserGroup]    Script Date: 09/22/2011 12:54:35 ******/
-SET ANSI_NULLS ON
-GO
-
-SET QUOTED_IDENTIFIER ON
-GO
-
-CREATE TABLE [dbo].[UserGroup](
-	[Id] [uniqueidentifier] NOT NULL,
-	[Name] [nvarchar](max) NOT NULL,
-	[ParentUserGroup] [uniqueidentifier] NULL,
- CONSTRAINT [PK_UserGroup] PRIMARY KEY CLUSTERED 
-(
-	[Id] ASC
-)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
-) ON [PRIMARY]
-
-GO
-
-/****** Object:  Table [dbo].[UserUserGroup]    Script Date: 09/22/2011 12:54:52 ******/
-SET ANSI_NULLS ON
-GO
-
-SET QUOTED_IDENTIFIER ON
-GO
-
-CREATE TABLE [dbo].[UserUserGroup](
-	[UserId] [uniqueidentifier] NOT NULL,
-	[UserGroupId] [uniqueidentifier] NOT NULL,
- CONSTRAINT [PK_UserUserGroup] PRIMARY KEY CLUSTERED 
-(
-	[UserId] ASC,
-	[UserGroupId] ASC
-)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
-) ON [PRIMARY]
-
-GO
-
-ALTER TABLE [dbo].[UserUserGroup]  WITH CHECK ADD  CONSTRAINT [FK_UserUserGroup_User] FOREIGN KEY([UserId])
-REFERENCES [dbo].[User] ([Id])
-GO
-
-ALTER TABLE [dbo].[UserUserGroup] CHECK CONSTRAINT [FK_UserUserGroup_User]
-GO
-
-ALTER TABLE [dbo].[UserUserGroup]  WITH CHECK ADD  CONSTRAINT [FK_UserUserGroup_UserGroup] FOREIGN KEY([UserGroupId])
+USE [HeuristicLab.ClientManagement]
+GO
+
+/****** Object:  Table [dbo].[ClientError]    Script Date: 09/23/2011 13:36:46 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[ClientError](
+	[Id] [uniqueidentifier] NOT NULL,
+	[Timestamp] [datetime] NOT NULL,
+	[Exception] [nvarchar](max) NULL,
+	[UserComment] [nvarchar](max) NULL,
+	[ConfigDump] [nvarchar](max) NULL,
+	[ClientId] [uniqueidentifier] NULL,
+	[UserId] [uniqueidentifier] NULL,
+ CONSTRAINT [PK_ClientError] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
+
+ALTER TABLE [dbo].[ClientError]  WITH CHECK ADD  CONSTRAINT [FK_ClientError_Resource] FOREIGN KEY([ClientId])
+REFERENCES [dbo].[Resource] ([Id])
+GO
+
+ALTER TABLE [dbo].[ClientError] CHECK CONSTRAINT [FK_ClientError_Resource]
+GO
+
+ALTER TABLE [dbo].[ClientError]  WITH CHECK ADD  CONSTRAINT [FK_ClientError_UserGroup] FOREIGN KEY([UserId])
 REFERENCES [dbo].[UserGroup] ([Id])
 GO
 
-ALTER TABLE [dbo].[UserUserGroup] CHECK CONSTRAINT [FK_UserUserGroup_UserGroup]
-GO
+ALTER TABLE [dbo].[ClientError] CHECK CONSTRAINT [FK_ClientError_UserGroup]
+GO
+
+/****** Object:  Table [dbo].[ClientConfiguration]    Script Date: 09/23/2011 13:36:55 ******/
+SET ANSI_NULLS ON
+GO
+
+SET QUOTED_IDENTIFIER ON
+GO
+
+CREATE TABLE [dbo].[ClientConfiguration](
+	[Id] [uniqueidentifier] NOT NULL,
+	[Hash] [nvarchar](max) NOT NULL,
+	[Description] [nvarchar](max) NULL,
+ CONSTRAINT [PK_ClientConfiguration] PRIMARY KEY CLUSTERED 
+(
+	[Id] ASC
+)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
+) ON [PRIMARY]
+
+GO
