-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRelationship.sql
36 lines (28 loc) · 1.1 KB
/
Relationship.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
USE [demoDb]
GO
/****** Object: Table [dbo].[Relationship] Script Date: 29-01-2022 11:55:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Relationship](
[RelationId] [bigint] NOT NULL,
[UserId] [bigint] IDENTITY(1,1) NOT NULL,
[ApplicationId] [bigint] NOT NULL,
[Relation] [varchar](50) NOT NULL,
CONSTRAINT [PK_Relationship_1] PRIMARY KEY CLUSTERED
(
[RelationId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Relationship] WITH CHECK ADD CONSTRAINT [ApplicationId] FOREIGN KEY([ApplicationId])
REFERENCES [dbo].[ProfileCreation] ([ApplicationId])
GO
ALTER TABLE [dbo].[Relationship] CHECK CONSTRAINT [ApplicationId]
GO
ALTER TABLE [dbo].[Relationship] WITH CHECK ADD CONSTRAINT [FK_Relationship_UserRegistration] FOREIGN KEY([UserId])
REFERENCES [dbo].[UserRegistration] ([UserId])
GO
ALTER TABLE [dbo].[Relationship] CHECK CONSTRAINT [FK_Relationship_UserRegistration]
GO