CREATE TABLE [dbo].[ProfileDocument] (
	[Id]           INT      IDENTITY (1, 1) NOT NULL,
	[FileId]       INT      NOT NULL,
	[UploadedDate] DATETIME NOT NULL,
	[DocumentTypeId] INT NOT NULL,
	[ProfileId]     INT NOT NULL,
	[IsDeleted] BIT NOT NULL DEFAULT 0, 
    CONSTRAINT [PK_ProfileDocument] PRIMARY KEY CLUSTERED ([Id] ASC),
	CONSTRAINT [FK_ProfileDocument_DocumentType] FOREIGN KEY ([DocumentTypeId]) REFERENCES [dbo].[DocumentType] ([Id]),
	CONSTRAINT [FK_ProfileDocument_FileData] FOREIGN KEY ([FileId]) REFERENCES [dbo].[FileData] ([Id]),
	CONSTRAINT [FK_ProfileDocument_Profile] FOREIGN KEY ([ProfileId]) REFERENCES [dbo].[Profile] ([Id])
);

