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