Y2S1-Database_Design/SQL/individual_creates/16 - Comment.Table.sql

26 lines
1.6 KiB
MySQL
Raw Permalink Normal View History

2020-06-07 21:29:59 +00:00
<EFBFBD><EFBFBD>USE [MediaLibrary]
GO
/****** Object: Table [dbo].[Comment] Script Date: 14/12/2018 00:20:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Comment](
[CommentID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [int] NOT NULL,
[PageID] [int] NOT NULL,
[Content] [text] NOT NULL,
[ParentComment] [int] NULL,
PRIMARY KEY CLUSTERED
(
[CommentID] 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].[Comment] WITH CHECK ADD FOREIGN KEY([PageID])
REFERENCES [dbo].[ContentPage] ([PageID])
GO
ALTER TABLE [dbo].[Comment] WITH CHECK ADD FOREIGN KEY([UserID])
REFERENCES [dbo].[Users] ([UserID])
GO