-
Notifications
You must be signed in to change notification settings - Fork 1
/
ServiceProblem2Service.sql
45 lines (34 loc) · 1.62 KB
/
ServiceProblem2Service.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
USE [TMF656]
GO
/****** Object: Table [dbo].[ServiceProblem2Service] Script Date: 10/30/2020 9:15:05 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ServiceProblem2Service](
[id] [uniqueidentifier] NOT NULL,
[ServiceProblem] [uniqueidentifier] NOT NULL,
[Service] [uniqueidentifier] NULL,
[RelationshipType] [varchar](50) NOT NULL,
[external_id] [varchar](max) NULL,
[external_href] [varchar](max) NULL,
CONSTRAINT [PK_ServiceProblem2AffectedService] 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] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[ServiceProblem2Service] ADD CONSTRAINT [DF_ServiceProblem2AffectedService_id] DEFAULT (newid()) FOR [id]
GO
ALTER TABLE [dbo].[ServiceProblem2Service] WITH CHECK ADD CONSTRAINT [FK_ServiceProblem2Service_Service] FOREIGN KEY([Service])
REFERENCES [dbo].[Service] ([id])
GO
ALTER TABLE [dbo].[ServiceProblem2Service] CHECK CONSTRAINT [FK_ServiceProblem2Service_Service]
GO
ALTER TABLE [dbo].[ServiceProblem2Service] WITH CHECK ADD CONSTRAINT [FK_ServiceProblem2Service_ServiceProblem] FOREIGN KEY([ServiceProblem])
REFERENCES [dbo].[ServiceProblem] ([id])
GO
ALTER TABLE [dbo].[ServiceProblem2Service] CHECK CONSTRAINT [FK_ServiceProblem2Service_ServiceProblem]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'AFFECTED or ROOT_CAUSE' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ServiceProblem2Service', @level2type=N'COLUMN',@level2name=N'RelationshipType'
GO