/****** Object:  Table [dbo].[Grids]    Script Date: 01/18/2011 14:30:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Grids](
	[ContentID] [int] NOT NULL,
	[Data] [xml] NOT NULL,
	[Config] [xml] NULL,
	[DTS] [datetime] NOT NULL CONSTRAINT [DF_Grids_DTS]  DEFAULT (getdate()),
	[UserID] [nvarchar](100) NOT NULL CONSTRAINT [DF_Grids_UserID]  DEFAULT (upper(suser_sname())),
	[LastChanged] [timestamp] NOT NULL,
 CONSTRAINT [PK_Grids] PRIMARY KEY CLUSTERED 
(
	[ContentID] 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
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Grids', @level2type=N'COLUMN',@level2name=N'DTS'
GO
ALTER TABLE [dbo].[Grids]  WITH CHECK ADD  CONSTRAINT [FK_Grids_Contents] FOREIGN KEY([ContentID])
REFERENCES [dbo].[Contents] ([ContentID])
GO
ALTER TABLE [dbo].[Grids] CHECK CONSTRAINT [FK_Grids_Contents]
/****** Object:  Table [dbo].[Images]    Script Date: 01/18/2011 14:32:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Images](
	[ContentID] [int] NOT NULL,
	[ImageType] [int] NOT NULL CONSTRAINT [DF_Images_ImageType]  DEFAULT ((1)),
	[FileName] [nvarchar](255) NOT NULL,
	[Data] [varbinary](max) NOT NULL,
	[Config] [xml] NULL,
	[DTS] [datetime] NOT NULL CONSTRAINT [DF_Images_DTS]  DEFAULT (getdate()),
	[UserID] [nvarchar](100) NOT NULL CONSTRAINT [DF_Images_UserID]  DEFAULT (upper(suser_sname())),
	[LastChanged] [timestamp] NOT NULL,
 CONSTRAINT [PK_Images] PRIMARY KEY CLUSTERED 
(
	[ContentID] 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
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'1 - Figure, 2 - Video, 3 - Audio' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Images', @level2type=N'COLUMN',@level2name=N'ImageType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'{datetime}' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Images', @level2type=N'COLUMN',@level2name=N'DTS'
GO
ALTER TABLE [dbo].[Images]  WITH CHECK ADD  CONSTRAINT [FK_Images_Contents] FOREIGN KEY([ContentID])
REFERENCES [dbo].[Contents] ([ContentID])
GO
ALTER TABLE [dbo].[Images] CHECK CONSTRAINT [FK_Images_Contents]