Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3.3-HiveMigration/tools/prepareHiveDatabase.sql @ 4170

Last change on this file since 4170 was 4170, checked in by cneumuel, 12 years ago

refactoring of Result-Polling of HiveExperiment, polling is now much faster and code is cleaner (1092#)

File size: 3.8 KB
Line 
1/* this script is supposed to be executed after the plain DB is generated by the linq-to-sql schema */
2
3/*
4use these DROP commands if you want to run this query a second time on the same db */
5/*
6ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId DROP ROWGUIDCOL;
7ALTER TABLE dbo.Job ALTER COLUMN JobId DROP ROWGUIDCOL;
8ALTER TABLE dbo.ClientConfig ALTER COLUMN ClientConfigId DROP ROWGUIDCOL;
9ALTER TABLE dbo.ClientGroup_Resource ALTER COLUMN ClientGroup_RessourceId DROP ROWGUIDCOL;
10ALTER TABLE dbo.PluginInfo ALTER COLUMN PluginId DROP ROWGUIDCOL;
11ALTER TABLE dbo.Project ALTER COLUMN ProjectId DROP ROWGUIDCOL;
12ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId DROP ROWGUIDCOL;
13ALTER TABLE dbo.Resource ALTER COLUMN ResourceId DROP ROWGUIDCOL;
14ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId DROP ROWGUIDCOL;
15ALTER TABLE dbo.UptimeStatistics ALTER COLUMN UptimeStatisticsId DROP ROWGUIDCOL;
16
17ALTER TABLE dbo.AssignedResources DROP CONSTRAINT [DF_AssignedResources_AssignedRessourcesId];
18ALTER TABLE dbo.Job DROP CONSTRAINT [DF_Job_JobId];
19ALTER TABLE dbo.ClientConfig DROP CONSTRAINT [DF_ClientConfig_ClientConfigId];
20ALTER TABLE dbo.ClientGroup_Resource DROP CONSTRAINT [DF_ClientGroup_ResourceClientGroup_RessourceId];
21ALTER TABLE dbo.PluginInfo DROP CONSTRAINT [DF_PluginInfo_PluginId];
22ALTER TABLE dbo.Project DROP CONSTRAINT [DF_Project_ProjectId];
23ALTER TABLE dbo.RequiredPlugins DROP CONSTRAINT [DF_RequiredPlugins_RequiredPluginId];
24ALTER TABLE dbo.Resource DROP CONSTRAINT [DF_Resource_ResourceId];
25ALTER TABLE dbo.UptimeCalendar DROP CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId];
26ALTER TABLE dbo.UptimeStatistics DROP CONSTRAINT [DF_UptimeStatistics_UptimeStatisticsId];
27*/
28
29
30ALTER TABLE dbo.AssignedResources ALTER COLUMN AssignedRessourcesId ADD ROWGUIDCOL;
31ALTER TABLE dbo.AssignedResources WITH NOCHECK ADD CONSTRAINT [DF_AssignedResources_AssignedRessourcesId] DEFAULT (newid()) FOR AssignedRessourcesId;
32
33ALTER TABLE dbo.Job ALTER COLUMN JobId ADD ROWGUIDCOL;
34ALTER TABLE dbo.Job WITH NOCHECK ADD CONSTRAINT [DF_Job_JobId] DEFAULT (newid()) FOR JobId;
35
36ALTER TABLE dbo.ClientConfig ALTER COLUMN ClientConfigId ADD ROWGUIDCOL;
37ALTER TABLE dbo.ClientConfig WITH NOCHECK ADD CONSTRAINT [DF_ClientConfig_ClientConfigId] DEFAULT (newid()) FOR ClientConfigId;
38
39ALTER TABLE dbo.ClientGroup_Resource ALTER COLUMN ClientGroup_RessourceId ADD ROWGUIDCOL;
40ALTER TABLE dbo.ClientGroup_Resource WITH NOCHECK ADD CONSTRAINT [DF_ClientGroup_Resource_ClientGroup_RessourceId] DEFAULT (newid()) FOR ClientGroup_RessourceId;
41
42ALTER TABLE dbo.PluginInfo ALTER COLUMN PluginId ADD ROWGUIDCOL;
43ALTER TABLE dbo.PluginInfo WITH NOCHECK ADD CONSTRAINT [DF_PluginInfo_PluginId] DEFAULT (newid()) FOR PluginId;
44
45ALTER TABLE dbo.Project ALTER COLUMN ProjectId ADD ROWGUIDCOL;
46ALTER TABLE dbo.Project WITH NOCHECK ADD CONSTRAINT [DF_Project_ProjectId] DEFAULT (newid()) FOR ProjectId;
47
48ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId ADD ROWGUIDCOL;
49ALTER TABLE dbo.RequiredPlugins WITH NOCHECK ADD CONSTRAINT [DF_RequiredPlugins_RequiredPluginId] DEFAULT (newid()) FOR RequiredPluginId;
50
51ALTER TABLE dbo.Resource ALTER COLUMN ResourceId ADD ROWGUIDCOL;
52ALTER TABLE dbo.Resource WITH NOCHECK ADD CONSTRAINT [DF_Resource_ResourceId] DEFAULT (newid()) FOR ResourceId;
53
54ALTER TABLE dbo.UptimeCalendar ALTER COLUMN UptimeCalendarId ADD ROWGUIDCOL;
55ALTER TABLE dbo.UptimeCalendar WITH NOCHECK ADD CONSTRAINT [DF_UptimeCalendar_UptimeCalendarId] DEFAULT (newid()) FOR UptimeCalendarId;
56
57ALTER TABLE dbo.UptimeStatistics ALTER COLUMN UptimeStatisticsId ADD ROWGUIDCOL;
58ALTER TABLE dbo.UptimeStatistics WITH NOCHECK ADD CONSTRAINT [DF_UptimeStatistics_UptimeStatisticsId] DEFAULT (newid()) FOR UptimeStatisticsId;
59
60/* create indices */
61CREATE INDEX Index_RequiredPlugins_JobId ON RequiredPlugins(JobId);
Note: See TracBrowser for help on using the repository browser.