序号 | 列名 | 数据类型 | 长度 | 小数位 | 标识 | 主键 | 外键 | 允许空 | 默认值 | 说明 |
1 | CommentID | int | 4 | 0 | 是 | 是 | 否 | 主键ID | ||
2 | GeneralID | int | 4 | 0 | 否 | 内容ID | ||||
3 | Title | nvarchar | 255 | 0 | 是 | 评论的标题 | ||||
4 | Contents | nvarchar | 300 | 0 | 否 | 评论 | ||||
5 | Audited | bit | 1 | 0 | 否 | 0 | 是否审核 | |||
6 | UserID | int | 4 | 0 | 否 | |||||
7 | CommentTime | datetime | 8 | 3 | 否 | getdate | 评论时间 | |||
8 | Score | int | 4 | 0 | 否 | 0 | 评论得分 | |||
9 | PKS | bit | 1 | 0 | 是 | 0 | 0=反对 1=支持 | |||
10 | files | nvarchar | 200 | 0 | 是 | 附件 | ||||
11 | status | int | 4 | 0 | 是 | 0 | ||||
12 | pid | int | 4 | 0 | 是 | 0 | 父评论ID | |||
13 | Type | int | 4 | 0 | 是 | 0 | 评论类型 | |||
14 | ReprotIDS | nvarchar | 1000 | 0 | 否 | '' | 举报人 |
评论表
GO
CREATE TABLE [dbo].[ZL_Comment](
[CommentID] [int] IDENTITY(1,1) NOT NULL,
[GeneralID] [int] NOT NULL,
[Title] [nvarchar](255) NULL,
[Contents] [nvarchar](300) NOT NULL,
[Audited] [bit] NOT NULL CONSTRAINT [DF_ZL_Comment_Audited] DEFAULT (0),
[UserID] [int] NOT NULL,
[CommentTime] [datetime] NOT NULL CONSTRAINT [DF_ZL_Comment_CommentTime] DEFAULT (getdate()),
[Score] [int] NOT NULL CONSTRAINT [DF_ZL_Comment_Score] DEFAULT (0),
[PKS] [bit] NULL CONSTRAINT [DF_ZL_Comment_PKS] DEFAULT (0),
[files] [nvarchar](200) NULL,
[status] [int] NULL CONSTRAINT [DF_ZL_Comment_status] DEFAULT (0),
[pid] [int] NULL CONSTRAINT [DF_ZL_Comment_pid] DEFAULT (0),
[Type] [int] NULL CONSTRAINT [DF_ZL_Comment_Type] DEFAULT (0),
[ReprotIDS] [nvarchar](1000) NOT NULL,
CONSTRAINT [PK_ZL_Comment] PRIMARY KEY CLUSTERED
([CommentID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ZL_Comment] ADD CONSTRAINT [DF_ZL_Comment_ReprotIDS] DEFAULT ('') FOR [ReprotIDS]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论的标题' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'ZL_Comment', @level2type=N'COLUMN', @level2name=N'Title'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0=反对 1=支持' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'ZL_Comment', @level2type=N'COLUMN', @level2name=N'PKS'
detele from ZL_Comment
drop table ZL_Comment
TRUNCATE table ZL_Comment