/****** Object: Table [dbo].[Pub_JiaoYanQuan] Script Date: 09/02/2015 14:57:56 ******/ SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON IF not EXISTS (SELECT * FROM sysobjects WHERE name = 'Pub_JiaoYanQuan') Begin CREATE TABLE [dbo].[Pub_JiaoYanQuan]( [Guid] [nvarchar](32) NOT NULL, [Version] [int] NOT NULL, [SortNumber] [int] NOT NULL, [Status] [int] NOT NULL, [UserGuid] [nvarchar](32) NOT NULL, [CategoryGuid] [nvarchar](32) NOT NULL, [GradeGuid] [nvarchar](32) NOT NULL, [Name] [nvarchar](256) NOT NULL, [Cover] [nvarchar](256) NULL, [Ad] [nvarchar](256) NULL, [Description] [nvarchar](2000) NULL, [JoinType] [int] NOT NULL, [VideoView] [int] NOT NULL, [CommentCount] [int] NOT NULL, [CollectCount] [int] NOT NULL, [CreateTime] [datetime] NOT NULL, CONSTRAINT [PK_PUB_JIAOYANQUAN] PRIMARY KEY CLUSTERED ( [Guid] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Guid type:text primary:true tooltip:记录主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Guid' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'版本号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Version' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'排序号 type:text default:0 required:true required_msg:排序号不能为空 required_default:null regex:num1 regex_msg:排序号应为数字 tooltip:标示记录在相同类型的记录中的位置' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'SortNumber' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态 type:checkbox enum:{作废=0,有效=1} default:0 tooltip:标示记录是否有效' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Status' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属用户 type:selectbox fk_table:Pub_User fk_key:Guid fk_name:Name required:true required_msg:请选择所属用户 required_default:null' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'UserGuid' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属类型 type:selectbox fk_table:Pub_Category fk_key:Guid fk_name:Name required:true required_msg:请选择所属类型 required_default:null' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'CategoryGuid' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所属年级段 type:selectbox fk_table:Pub_Grade fk_key:Guid fk_name:Name required:true required_msg:请选择所属年级段 required_default:null' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'GradeGuid' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'圈子名称 type:text required:true required_msg:请输入圈子名称 required_default:null' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Name' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'封面 type:image width:290 height:230' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Cover' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'海报图 type:image' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Ad' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'描述 type:textarea css:width400 height100' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'Description' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'加入方式 type:checkbox enum:{用户自由加入=0,通过申请加入=1,通过邀请加入=2} default:0 tooltip:圈子加入方式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'JoinType' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'点击量 type:text forbidpost:true' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'VideoView' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评论数 type:text forbidpost:true' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'CommentCount' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'收藏数 type:text forbidpost:true' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'CollectCount' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间 type:datetime required:true required_msg:请选择创建时间 required_default:null regex:datetime regex_msg:创建时间格式不正确' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan', @level2type=N'COLUMN',@level2name=N'CreateTime' EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'教研圈 ref_table:Pub_JYQUser|Delete|SortNumber ASC,Pub_JYQUserApply|Delete|SortNumber ASC,Pub_JYQVideo|Delete|SortNumber ASC,Pub_JYQNotice|Delete|SortNumber ASC,Pub_JYQAttachment|Delete|SortNumber ASC,Pub_JYQBeiKe|Delete|SortNumber ASC autosort:SortNumber ASC fk_name:Pub_User.TrueName,Name ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Pub_JiaoYanQuan' ALTER TABLE [dbo].[Pub_JiaoYanQuan] ADD DEFAULT ((0)) FOR [JoinType] END