Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Services.Deployment.DataAccess/3.3/CreateDeploymentServiceDatabase.sql @ 3871

Last change on this file since 3871 was 3180, checked in by gkronber, 15 years ago

Updated SQL script to create the DB for the deployment service. #918.

File size: 5.1 KB
Line 
1USE [HeuristicLab.Deployment]
2GO
3/****** Object:  User [DeploymentService]    Script Date: 03/22/2010 15:57:21 ******/
4CREATE USER [DeploymentService] FOR LOGIN [SERVDEV\DeploymentService] WITH DEFAULT_SCHEMA=[dbo]
5GO
6/****** Object:  Table [dbo].[Plugin]    Script Date: 03/22/2010 15:57:25 ******/
7SET ANSI_NULLS ON
8GO
9SET QUOTED_IDENTIFIER ON
10GO
11CREATE TABLE [dbo].[Plugin](
12  [Id] [bigint] IDENTITY(1,1) NOT NULL,
13  [Name] [nvarchar](300) NOT NULL,
14  [Version] [nvarchar](50) NOT NULL,
15  [ContactName] [text] NULL,
16  [ContactEmail] [text] NULL,
17  [License] [text] NULL,
18 CONSTRAINT [PK_Plugin] PRIMARY KEY CLUSTERED
19(
20  [Id] ASC
21)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
22 CONSTRAINT [IX_Plugin_NameVersion] UNIQUE NONCLUSTERED
23(
24  [Name] ASC,
25  [Version] ASC
26)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
27) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
28GO
29/****** Object:  Table [dbo].[Product]    Script Date: 03/22/2010 15:57:25 ******/
30SET ANSI_NULLS ON
31GO
32SET QUOTED_IDENTIFIER ON
33GO
34CREATE TABLE [dbo].[Product](
35  [Id] [bigint] IDENTITY(1,1) NOT NULL,
36  [Name] [nvarchar](300) NOT NULL,
37  [Version] [nvarchar](50) NOT NULL,
38 CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED
39(
40  [Id] ASC
41)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
42 CONSTRAINT [IX_Product_NameVersion] UNIQUE NONCLUSTERED
43(
44  [Name] ASC,
45  [Version] ASC
46)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
47) ON [PRIMARY]
48GO
49/****** Object:  Table [dbo].[ProductPlugin]    Script Date: 03/22/2010 15:57:25 ******/
50SET ANSI_NULLS ON
51GO
52SET QUOTED_IDENTIFIER ON
53GO
54CREATE TABLE [dbo].[ProductPlugin](
55  [ProductId] [bigint] NOT NULL,
56  [PluginId] [bigint] NOT NULL,
57 CONSTRAINT [PK_ProductPlugin] PRIMARY KEY CLUSTERED
58(
59  [ProductId] ASC,
60  [PluginId] ASC
61)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
62) ON [PRIMARY]
63GO
64/****** Object:  Table [dbo].[PluginPackage]    Script Date: 03/22/2010 15:57:25 ******/
65SET ANSI_NULLS ON
66GO
67SET QUOTED_IDENTIFIER ON
68GO
69CREATE TABLE [dbo].[PluginPackage](
70  [PluginId] [bigint] NOT NULL,
71  [Data] [image] NOT NULL,
72 CONSTRAINT [PK_PluginPackage] PRIMARY KEY CLUSTERED
73(
74  [PluginId] ASC
75)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
76) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
77GO
78/****** Object:  Table [dbo].[Dependencies]    Script Date: 03/22/2010 15:57:25 ******/
79SET ANSI_NULLS ON
80GO
81SET QUOTED_IDENTIFIER ON
82GO
83CREATE TABLE [dbo].[Dependencies](
84  [PluginId] [bigint] NOT NULL,
85  [DependencyId] [bigint] NOT NULL,
86 CONSTRAINT [PK_Dependencies] PRIMARY KEY CLUSTERED
87(
88  [PluginId] ASC,
89  [DependencyId] ASC
90)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
91) ON [PRIMARY]
92GO
93/****** Object:  Check [CK_Dependencies]    Script Date: 03/22/2010 15:57:25 ******/
94ALTER TABLE [dbo].[Dependencies]  WITH CHECK ADD  CONSTRAINT [CK_Dependencies] CHECK  (([PluginId]<>[DependencyId]))
95GO
96ALTER TABLE [dbo].[Dependencies] CHECK CONSTRAINT [CK_Dependencies]
97GO
98/****** Object:  ForeignKey [FK_ProductPlugin_Plugin]    Script Date: 03/22/2010 15:57:25 ******/
99ALTER TABLE [dbo].[ProductPlugin]  WITH CHECK ADD  CONSTRAINT [FK_ProductPlugin_Plugin] FOREIGN KEY([PluginId])
100REFERENCES [dbo].[Plugin] ([Id])
101GO
102ALTER TABLE [dbo].[ProductPlugin] CHECK CONSTRAINT [FK_ProductPlugin_Plugin]
103GO
104/****** Object:  ForeignKey [FK_ProductPlugin_Product]    Script Date: 03/22/2010 15:57:25 ******/
105ALTER TABLE [dbo].[ProductPlugin]  WITH CHECK ADD  CONSTRAINT [FK_ProductPlugin_Product] FOREIGN KEY([ProductId])
106REFERENCES [dbo].[Product] ([Id])
107GO
108ALTER TABLE [dbo].[ProductPlugin] CHECK CONSTRAINT [FK_ProductPlugin_Product]
109GO
110/****** Object:  ForeignKey [FK_PluginPackage_Plugin]    Script Date: 03/22/2010 15:57:25 ******/
111ALTER TABLE [dbo].[PluginPackage]  WITH CHECK ADD  CONSTRAINT [FK_PluginPackage_Plugin] FOREIGN KEY([PluginId])
112REFERENCES [dbo].[Plugin] ([Id])
113GO
114ALTER TABLE [dbo].[PluginPackage] CHECK CONSTRAINT [FK_PluginPackage_Plugin]
115GO
116/****** Object:  ForeignKey [FK_Dependencies_Plugin]    Script Date: 03/22/2010 15:57:25 ******/
117ALTER TABLE [dbo].[Dependencies]  WITH CHECK ADD  CONSTRAINT [FK_Dependencies_Plugin] FOREIGN KEY([DependencyId])
118REFERENCES [dbo].[Plugin] ([Id])
119GO
120ALTER TABLE [dbo].[Dependencies] CHECK CONSTRAINT [FK_Dependencies_Plugin]
121GO
122/****** Object:  ForeignKey [FK_Dependencies_Plugin2]    Script Date: 03/22/2010 15:57:25 ******/
123ALTER TABLE [dbo].[Dependencies]  WITH CHECK ADD  CONSTRAINT [FK_Dependencies_Plugin2] FOREIGN KEY([PluginId])
124REFERENCES [dbo].[Plugin] ([Id])
125GO
126ALTER TABLE [dbo].[Dependencies] CHECK CONSTRAINT [FK_Dependencies_Plugin2]
127GO
Note: See TracBrowser for help on using the repository browser.