CREATE TABLE [dbo].[ICMakeCustomProperties]
(
[MakeCustomPropertyID] [int] NOT NULL IDENTITY(1, 1),
[MakeID] [int] NOT NULL,
[ShAttributeID] [int] NOT NULL,
[IDVal] [int] NULL,
[TextVal] [varchar] (1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Required] [bit] NOT NULL CONSTRAINT [DF_ICMakeCustomProperties_Required] DEFAULT ((0)),
[CreatorID] [char] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_ICMakeCustomProperties_CreateDate] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICMakeCustomProperties] ADD CONSTRAINT [PK_ICMakeCustomProperties] PRIMARY KEY CLUSTERED ([MakeCustomPropertyID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ICMakeCustomProperties] ADD CONSTRAINT [FK_ICMakeCustomProperties_MakeID_ICMakes] FOREIGN KEY ([MakeID]) REFERENCES [dbo].[ICMakes] ([MakeID])
GO
ALTER TABLE [dbo].[ICMakeCustomProperties] ADD CONSTRAINT [FK_ICMakeCustomProperties_ShAttributeID_ShAttributes] FOREIGN KEY ([ShAttributeID]) REFERENCES [dbo].[ShAttributes] ([ShAttributeID])
GO