Skip to content

Commit 76e5329

Browse files
committed
TD06625
1 parent d33eb31 commit 76e5329

File tree

4 files changed

+42
-40
lines changed

4 files changed

+42
-40
lines changed

WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
<Build Include="Tables\Elfh\MergeUserTBL.sql" />
211211
<None Include="Scripts\Pre-Deploy\Scripts\TD-6159-turn-off-cdc.sql" />
212212
<None Include="Scripts\Post-Deploy\Scripts\TD-6159-turn-on-cdc.sql" />
213+
<None Include="Scripts\Post-Deploy\Scripts\TD-6625-AddtionalTable&amp;CDC.sql" />
213214
</ItemGroup>
214215
<ItemGroup>
215216
<RefactorLog Include="LearningHub.Nhs.Database.refactorlog" />
@@ -578,7 +579,6 @@
578579
<Build Include="Tables\Elfh\UserAttributeTBL.sql" />
579580
<Build Include="Tables\Elfh\UserEmploymentTBL.sql" />
580581
<Build Include="Tables\Elfh\UserGroupTypeInputValidationTBL.sql" />
581-
<Build Include="Tables\Elfh\UserHistoryAttributeTBL.sql" />
582582
<Build Include="Tables\Elfh\UserHistoryTBL.sql" />
583583
<Build Include="Tables\Elfh\userHistoryTypeTBL.sql" />
584584
<Build Include="Tables\Elfh\UserPasswordValidationTokenTBL.sql" />
@@ -693,6 +693,7 @@
693693
<Build Include="Tables\Adf\ADFSyncMetadata.sql" />
694694
<Build Include="Stored Procedures\Adf\proc_UpdateLastSyncTimeAdf.sql" />
695695
<Build Include="Tables\Databricks\ReportHistory.sql" />
696+
<Build Include="Tables\Elfh\UserGroupReporterTBL.sql" />
696697
</ItemGroup>
697698
<ItemGroup>
698699
<None Include="Scripts\Pre-Deploy\Scripts\Card5766_AuthorTableChanges.PreDeployment.sql" />
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- DROP NodeEditor table
2+
DROP TABLE elfh.userHistoryAttributeTBL
3+
4+
--Enable CDC
5+
EXEC sys.sp_cdc_enable_table
6+
@source_schema = N'elfh',
7+
@source_name = N'userReportingUserTBL',
8+
@role_name = NULL,
9+
@supports_net_changes = 0;
10+
GO
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CREATE TABLE [elfh].[userGroupReporterTBL](
2+
[userGroupReporterId] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
3+
[userId] [int] NOT NULL,
4+
[userGroupId] [int] NOT NULL,
5+
[deleted] [bit] NOT NULL,
6+
[amendUserId] [int] NOT NULL,
7+
[amendDate] [datetimeoffset](7) NOT NULL,
8+
CONSTRAINT [PK_userGroupReporterTBL] PRIMARY KEY CLUSTERED
9+
(
10+
[userGroupReporterId] ASC
11+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
12+
) ON [PRIMARY]
13+
GO
14+
15+
ALTER TABLE [elfh].[userGroupReporterTBL] ADD DEFAULT (sysdatetimeoffset()) FOR [amendDate]
16+
GO
17+
18+
ALTER TABLE [elfh].[userGroupReporterTBL] WITH CHECK ADD CONSTRAINT [FK_userGroupReporterTBL_userGroupTBL] FOREIGN KEY([userGroupId])
19+
REFERENCES [hub].[userGroup] ([Id])
20+
GO
21+
22+
ALTER TABLE [elfh].[userGroupReporterTBL] CHECK CONSTRAINT [FK_userGroupReporterTBL_userGroupTBL]
23+
GO
24+
25+
ALTER TABLE [elfh].[userGroupReporterTBL] WITH CHECK ADD CONSTRAINT [FK_userGroupReporterTBL_userTBL] FOREIGN KEY([userId])
26+
REFERENCES [hub].[user] ([Id])
27+
GO
28+
29+
ALTER TABLE [elfh].[userGroupReporterTBL] CHECK CONSTRAINT [FK_userGroupReporterTBL_userTBL]
30+
GO

WebAPI/LearningHub.Nhs.Database/Tables/Elfh/UserHistoryAttributeTBL.sql

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)