Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#39 SQL scripts for all table creation statements
- Loading branch information
Showing
4 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
SET ANSI_NULLS ON | ||
GO | ||
|
||
SET QUOTED_IDENTIFIER ON | ||
GO | ||
|
||
CREATE TABLE [dbo].[ConversationSummary]( | ||
[Rsn] [uniqueidentifier] NOT NULL, | ||
[IsLogicallyDeleted] [bit] NOT NULL, | ||
[SortingOrder] [int] NOT NULL, | ||
[Name] [nvarchar](255) NOT NULL, | ||
[MessageCount] [int] NOT NULL, | ||
[LastUpdatedDate] [datetime] NOT NULL, | ||
CONSTRAINT [PK_ConversationSummary] PRIMARY KEY CLUSTERED | ||
( | ||
[Rsn] ASC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
) ON [PRIMARY] | ||
|
||
GO | ||
|
||
ALTER TABLE [dbo].[ConversationSummary] ADD CONSTRAINT [DF_ConversationSummary_IsLogicallyDeleted] DEFAULT ((0)) FOR [IsLogicallyDeleted] | ||
GO | ||
|
||
ALTER TABLE [dbo].[ConversationSummary] ADD CONSTRAINT [DF_ConversationSummary_MessageCount] DEFAULT ((0)) FOR [MessageCount] | ||
GO | ||
|
||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'A summary of conversations' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConversationSummary' | ||
GO | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
USE [Chat] | ||
GO | ||
|
||
SET ANSI_NULLS ON | ||
GO | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
SET ANSI_NULLS ON | ||
GO | ||
|
||
SET QUOTED_IDENTIFIER ON | ||
GO | ||
|
||
CREATE TABLE [dbo].[Messages]( | ||
[Rsn] [uniqueidentifier] NOT NULL, | ||
[IsLogicallyDeleted] [bit] NOT NULL, | ||
[SortingOrder] [int] NOT NULL, | ||
[ConversationRsn] [uniqueidentifier] NOT NULL, | ||
[ConversationName] [nvarchar](255) NOT NULL, | ||
[UserRsn] [uniqueidentifier] NOT NULL, | ||
[UserName] [nvarchar](255) NOT NULL, | ||
[Content] [text] NOT NULL, | ||
[DatePosted] [datetime] NOT NULL, | ||
CONSTRAINT [PK_Messages] PRIMARY KEY CLUSTERED | ||
( | ||
[Rsn] 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].[Messages] ADD CONSTRAINT [DF_Messages_IsLogicallyDeleted] DEFAULT ((0)) FOR [IsLogicallyDeleted] | ||
GO | ||
|
||
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Conversation messages' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Messages' | ||
GO | ||
|
||
CREATE NONCLUSTERED INDEX [IX_ConversationRsn_DatePosted] ON [dbo].[Messages] | ||
( | ||
[ConversationRsn] ASC, | ||
[DatePosted] DESC | ||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) | ||
GO | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
USE [Chat] | ||
GO | ||
|
||
SET ANSI_NULLS ON | ||
GO | ||
|
||
|