Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/CreateHiveDatabaseApplication.cs
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/CreateHiveDatabaseApplication.cs	(revision 5078)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/CreateHiveDatabaseApplication.cs	(revision 5106)
@@ -21,7 +21,9 @@
 
 using HeuristicLab.PluginInfrastructure;
+using System.IO;
+using System.Windows.Forms;
 
 namespace HeuristicLab.Services.Hive.DataAccess {
-  [Application("Create Hive-3.4 Database", "Creates new empty Hive Database.", true)]
+  [Application("Create Hive-3.4 Database", "Creates new empty Hive Database.", false)]
   class CreateHiveDatabaseApplication : ApplicationBase {
 
@@ -31,5 +33,12 @@
           db.DeleteDatabase();
         db.CreateDatabase();
+        using (var sr = new StreamReader("../../../../HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql")) {
+          var commands = sr.ReadToEnd().Split(new string[] {"GO\r"}, System.StringSplitOptions.RemoveEmptyEntries);
+          foreach (var cmd in commands) {
+            db.ExecuteCommand(cmd);
+          }
+        }
       }
+      MessageBox.Show("Successfully created HeuristicLab.Hive-3.4 database.");
     }
   }
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/cleanHiveDatabase.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/cleanHiveDatabase.sql	(revision 5078)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/cleanHiveDatabase.sql	(revision 5106)
@@ -1,17 +1,19 @@
-DELETE FROM [HeuristicLab.Hive].[dbo].AssignedResources
-DELETE FROM [HeuristicLab.Hive].[dbo].RequiredPlugins
-DELETE FROM [HeuristicLab.Hive].[dbo].PluginInfo
-DELETE FROM [HeuristicLab.Hive].[dbo].UptimeStatistics
-DELETE FROM [HeuristicLab.Hive].[dbo].UptimeCalendar
-DELETE FROM [HeuristicLab.Hive].[dbo].SlaveConfig
-DELETE FROM [HeuristicLab.Hive].[dbo].SlaveGroup_Resource
-DELETE FROM [HeuristicLab.Hive].[dbo].[Resource]
-DELETE FROM [HeuristicLab.Hive].[dbo].HiveExperiment
-DELETE FROM [HeuristicLab.Hive].[dbo].Job
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].AssignedResources
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].RequiredPlugins
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].PluginData
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Plugin
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].UptimeCalendar
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].SlaveGroup_Resource
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].[Resource]
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].HiveExperiment
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].JobData
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Job
 
 /** only jobs & experiments **/
-DELETE FROM [HeuristicLab.Hive].[dbo].AssignedResources
-DELETE FROM [HeuristicLab.Hive].[dbo].RequiredPlugins
-DELETE FROM [HeuristicLab.Hive].[dbo].PluginInfo
-DELETE FROM [HeuristicLab.Hive].[dbo].HiveExperiment
-DELETE FROM [HeuristicLab.Hive].[dbo].Job
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].AssignedResources
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].RequiredPlugins
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].PluginData
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Plugin
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].HiveExperiment
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].JobData
+DELETE FROM [HeuristicLab.Hive-3.4].[dbo].Job
Index: branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql
===================================================================
--- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql	(revision 5078)
+++ branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql	(revision 5106)
@@ -1,29 +1,23 @@
 /* this script is supposed to be executed after the plain DB is generated by the linq-to-sql schema */
 
-/*
-use these DROP commands if you want to run this query a second time on the same db */
+/* use these DROP commands if you want to run this query a second time on the same db */
+
 /*
 ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId DROP ROWGUIDCOL;
 ALTER TABLE dbo.Job ALTER COLUMN JobId DROP ROWGUIDCOL;
-ALTER TABLE dbo.SlaveConfig ALTER COLUMN SlaveConfigId DROP ROWGUIDCOL;
 ALTER TABLE dbo.SlaveGroup_Resource ALTER COLUMN SlaveGroup_RessourceId DROP ROWGUIDCOL;
 ALTER TABLE dbo.Plugin ALTER COLUMN PluginId DROP ROWGUIDCOL;
-ALTER TABLE dbo.Project ALTER COLUMN ProjectId DROP ROWGUIDCOL;
 ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId DROP ROWGUIDCOL;
 ALTER TABLE dbo.Resource ALTER COLUMN ResourceId DROP ROWGUIDCOL;
 ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId DROP ROWGUIDCOL;
-ALTER TABLE dbo.UptimeStatistics ALTER COLUMN UptimeStatisticsId DROP ROWGUIDCOL;
 ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId DROP ROWGUIDCOL;
 
 ALTER TABLE dbo.AssignedResources DROP CONSTRAINT [DF_AssignedResources_AssignedRessourcesId];
 ALTER TABLE dbo.Job DROP CONSTRAINT [DF_Job_JobId];
-ALTER TABLE dbo.SlaveConfig DROP CONSTRAINT [DF_SlaveConfig_SlaveConfigId];
 ALTER TABLE dbo.SlaveGroup_Resource DROP CONSTRAINT [DF_SlaveGroup_ResourceSlaveGroup_RessourceId];
 ALTER TABLE dbo.Plugin DROP CONSTRAINT [DF_Plugin_PluginId];
-ALTER TABLE dbo.Project DROP CONSTRAINT [DF_Project_ProjectId];
 ALTER TABLE dbo.RequiredPlugins DROP CONSTRAINT [DF_RequiredPlugins_RequiredPluginId];
 ALTER TABLE dbo.Resource DROP CONSTRAINT [DF_Resource_ResourceId];
 ALTER TABLE dbo.UptimeCalendar DROP CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId];
-ALTER TABLE dbo.UptimeStatistics DROP CONSTRAINT [DF_UptimeStatistics_UptimeStatisticsId];
 ALTER TABLE dbo.HiveExperiment DROP CONSTRAINT [DF_HiveExperiment_HiveExperimentId];
 */
@@ -47,15 +41,6 @@
 ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (newid()) FOR JobId;
 
-ALTER TABLE dbo.SlaveConfig ALTER COLUMN SlaveConfigId ADD ROWGUIDCOL;
-ALTER TABLE dbo.SlaveConfig WITH NOCHECK ADD CONSTRAINT [DF_SlaveConfig_SlaveConfigId] DEFAULT (newid()) FOR SlaveConfigId;
-
-ALTER TABLE dbo.SlaveGroup_Resource ALTER COLUMN SlaveGroup_RessourceId ADD ROWGUIDCOL;
-ALTER TABLE dbo.SlaveGroup_Resource WITH NOCHECK ADD CONSTRAINT [DF_SlaveGroup_Resource_SlaveGroup_RessourceId] DEFAULT (newid()) FOR SlaveGroup_RessourceId;
-
 ALTER TABLE dbo.Plugin ALTER COLUMN PluginId ADD ROWGUIDCOL;
 ALTER TABLE dbo.Plugin WITH NOCHECK ADD CONSTRAINT [DF_Plugin_PluginId] DEFAULT (newid()) FOR PluginId;
-
-ALTER TABLE dbo.Project ALTER COLUMN ProjectId ADD ROWGUIDCOL;
-ALTER TABLE dbo.Project WITH NOCHECK ADD CONSTRAINT [DF_Project_ProjectId] DEFAULT (newid()) FOR ProjectId;
 
 ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId ADD ROWGUIDCOL;
@@ -81,7 +66,4 @@
 ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId ADD ROWGUIDCOL;
 ALTER TABLE dbo.UptimeCalendar WITH NOCHECK ADD CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId] DEFAULT (newid()) FOR UptimeCalendarId;
-
-ALTER TABLE dbo.UptimeStatistics ALTER COLUMN UptimeStatisticsId ADD ROWGUIDCOL;
-ALTER TABLE dbo.UptimeStatistics WITH NOCHECK ADD CONSTRAINT [DF_UptimeStatistics_UptimeStatisticsId] DEFAULT (newid()) FOR UptimeStatisticsId;
 
 ALTER TABLE dbo.HiveExperiment ALTER COLUMN HiveExperimentId ADD ROWGUIDCOL;
@@ -137,4 +119,5 @@
 	END
 	
+	DELETE JobData FROM JobData INNER JOIN #Table ON JobData.JobId = #Table.JobId
 	DELETE Job FROM Job INNER JOIN #Table ON Job.JobId = #Table.JobId
 END
