Skip to content

Commit 982bff9

Browse files
committed
table script
1 parent b3422db commit 982bff9

37 files changed

+1153
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<Name>LearningHub.Nhs.UserApi.Database</Name>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectVersion>4.1</ProjectVersion>
9+
<ProjectGuid>{bdab7190-d505-421d-874d-c9f49574c9df}</ProjectGuid>
10+
<DSP>Microsoft.Data.Tools.Schema.Sql.Sql160DatabaseSchemaProvider</DSP>
11+
<OutputType>Database</OutputType>
12+
<RootPath />
13+
<RootNamespace>LearningHub.Nhs.UserApi.Database</RootNamespace>
14+
<AssemblyName>LearningHub.Nhs.UserApi.Database</AssemblyName>
15+
<ModelCollation>1033, CI</ModelCollation>
16+
<DefaultFileStructure>BySchemaAndSchemaType</DefaultFileStructure>
17+
<DeployToDatabase>True</DeployToDatabase>
18+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
19+
<TargetLanguage>CS</TargetLanguage>
20+
<AppDesignerFolder>Properties</AppDesignerFolder>
21+
<SqlServerVerification>False</SqlServerVerification>
22+
<IncludeCompositeObjects>True</IncludeCompositeObjects>
23+
<TargetDatabaseSet>True</TargetDatabaseSet>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<OutputPath>bin\Release\</OutputPath>
27+
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
28+
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<DefineDebug>false</DefineDebug>
32+
<DefineTrace>true</DefineTrace>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
37+
<OutputPath>bin\Debug\</OutputPath>
38+
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
39+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
40+
<DebugSymbols>true</DebugSymbols>
41+
<DebugType>full</DebugType>
42+
<Optimize>false</Optimize>
43+
<DefineDebug>true</DefineDebug>
44+
<DefineTrace>true</DefineTrace>
45+
<ErrorReport>prompt</ErrorReport>
46+
<WarningLevel>4</WarningLevel>
47+
</PropertyGroup>
48+
<PropertyGroup>
49+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
50+
<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>
51+
<VisualStudioVersion Condition="'$(SSDTExists)' == ''">11.0</VisualStudioVersion>
52+
</PropertyGroup>
53+
<Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
54+
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
55+
<ItemGroup>
56+
<Folder Include="Properties" />
57+
<Folder Include="Tables" />
58+
<Folder Include="Schemas" />
59+
<Folder Include="Stored Procedures" />
60+
<Folder Include="Views" />
61+
<Folder Include="Tables\Elfh" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<Build Include="Schemas\elfh.sql" />
65+
<Build Include="Tables\Elfh\GdcRegister.sql" />
66+
</ItemGroup>
67+
<ItemGroup>
68+
<None Include="Tables\Elfh\GmcLrmp.sql" />
69+
<None Include="Tables\Elfh\Location.sql" />
70+
<None Include="Tables\Elfh\CountryTBL.sql" />
71+
<None Include="Tables\Elfh\GradeTBL.sql" />
72+
<None Include="Tables\Elfh\IpCountryLookupTBL.sql" />
73+
<None Include="Tables\Elfh\JobRoleTBL.sql" />
74+
<None Include="Tables\Elfh\MedicalCouncilTBL.sql" />
75+
<None Include="Tables\Elfh\RegionTBL.sql" />
76+
<None Include="Tables\Elfh\SpecialtyTBL.sql" />
77+
<None Include="Tables\Elfh\StaffGroupTBL.sql" />
78+
<None Include="Tables\Elfh\EmailTemplateTBL.sql" />
79+
<None Include="Tables\Elfh\UserGroupTypeInputValidationTBL.sql" />
80+
<None Include="Tables\Elfh\LoginWizardRuleTBL.sql" />
81+
<None Include="Tables\Elfh\LoginWizardStageActivityTBL.sql" />
82+
<None Include="Tables\Elfh\TermsAndConditionsTBL.sql" />
83+
<None Include="Tables\Elfh\UserTermsAndConditionsTBL.sql" />
84+
<None Include="Tables\Elfh\UserRoleUpgradeTBL.sql" />
85+
<None Include="Tables\Elfh\ExternalSystemTBL.sql" />
86+
<None Include="Tables\Elfh\SystemSettingTBL.sql" />
87+
<None Include="Tables\Elfh\TenantTBL.sql" />
88+
<None Include="Tables\Elfh\TenantSmtpTBL.sql" />
89+
<None Include="Tables\Elfh\TenantUrlTBL.sql" />
90+
<None Include="Tables\Elfh\UserAttributeTBL.sql" />
91+
<None Include="Tables\Elfh\UserEmploymentTBL.sql" />
92+
<None Include="Tables\Elfh\UserHistoryTBL.sql" />
93+
<None Include="Tables\Elfh\UserHistoryAttributeTBL.sql" />
94+
<None Include="Tables\Elfh\UserPasswordValidationTokenTBL.sql" />
95+
<None Include="Tables\Elfh\EmailTemplateTypeTBL.sql" />
96+
</ItemGroup>
97+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE SCHEMA [elfh]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
CREATE TABLE [dbo].[attributeTBL](
2+
[attributeId] [int] IDENTITY(1,1) NOT NULL,
3+
[attributeTypeId] [int] NOT NULL,
4+
[attributeName] [nvarchar](50) NOT NULL,
5+
[attributeAccess] [tinyint] NOT NULL,
6+
[attributeDescription] [nvarchar](400) NULL,
7+
[deleted] [bit] NOT NULL,
8+
[amendUserId] [int] NOT NULL,
9+
[amendDate] [datetimeoffset](7) NOT NULL,
10+
CONSTRAINT [PK_attributeTBL] PRIMARY KEY CLUSTERED
11+
(
12+
[attributeId] ASC
13+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
14+
) ON [PRIMARY]
15+
GO
16+
17+
ALTER TABLE [dbo].[attributeTBL] ADD DEFAULT ((0)) FOR [attributeAccess]
18+
GO
19+
20+
ALTER TABLE [dbo].[attributeTBL] ADD DEFAULT ((0)) FOR [deleted]
21+
GO
22+
23+
ALTER TABLE [dbo].[attributeTBL] ADD DEFAULT (sysdatetimeoffset()) FOR [amendDate]
24+
GO
25+
26+
ALTER TABLE [dbo].[attributeTBL] WITH CHECK ADD CONSTRAINT [FK_attributeTBL_attributeTypeId] FOREIGN KEY([attributeTypeId])
27+
REFERENCES [dbo].[attributeTypeTBL] ([attributeTypeId])
28+
GO
29+
30+
ALTER TABLE [dbo].[attributeTBL] CHECK CONSTRAINT [FK_attributeTBL_attributeTypeId]
31+
GO
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CREATE TABLE [dbo].[attributeTypeTBL](
2+
[attributeTypeId] [int] NOT NULL,
3+
[attributeTypeName] [nvarchar](50) NOT NULL,
4+
[deleted] [bit] NOT NULL,
5+
[amendUserId] [int] NOT NULL,
6+
[amendDate] [datetimeoffset](7) NOT NULL,
7+
CONSTRAINT [PK_attributeTypeTBL] PRIMARY KEY CLUSTERED
8+
(
9+
[attributeTypeId] ASC
10+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
11+
) ON [PRIMARY]
12+
GO
13+
14+
ALTER TABLE [dbo].[attributeTypeTBL] ADD DEFAULT ((0)) FOR [deleted]
15+
GO
16+
17+
ALTER TABLE [dbo].[attributeTypeTBL] ADD DEFAULT (sysdatetimeoffset()) FOR [amendDate]
18+
GO
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
CREATE TABLE [dbo].[countryTBL](
2+
[countryId] [int] IDENTITY(1,1) NOT NULL,
3+
[countryName] [nvarchar](50) NULL,
4+
[alpha2] [nvarchar](2) NULL,
5+
[alpha3] [nvarchar](3) NULL,
6+
[numeric] [nvarchar](3) NULL,
7+
[EUVatRate] [float] NOT NULL,
8+
[displayOrder] [int] NOT NULL,
9+
[deleted] [bit] NOT NULL,
10+
[amendUserId] [int] NOT NULL,
11+
[amendDate] [datetimeoffset](7) NOT NULL,
12+
CONSTRAINT [PK_countryTBL] PRIMARY KEY CLUSTERED
13+
(
14+
[countryId] ASC
15+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
16+
) ON [PRIMARY]
17+
GO
18+
19+
ALTER TABLE [dbo].[countryTBL] ADD DEFAULT ((0)) FOR [EUVatRate]
20+
GO
21+
22+
ALTER TABLE [dbo].[countryTBL] ADD CONSTRAINT [DF_countryTBL_displayOrder] DEFAULT ((0)) FOR [displayOrder]
23+
GO
24+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CREATE TABLE [dbo].[deaneryTBL](
2+
[deaneryId] [int] IDENTITY(1,1) NOT NULL,
3+
[deaneryName] [nvarchar](50) NOT NULL,
4+
[displayOrder] [int] NOT NULL,
5+
[deleted] [bit] NOT NULL,
6+
[amendUserID] [int] NOT NULL,
7+
[amendDate] [datetimeoffset](7) NOT NULL,
8+
CONSTRAINT [PK_deaneryTBL] PRIMARY KEY CLUSTERED
9+
(
10+
[deaneryId] 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
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CREATE TABLE [dbo].[emailTemplateTBL](
2+
[emailTemplateId] [int] IDENTITY(1,1) NOT NULL,
3+
[emailTemplateTypeId] [int] NOT NULL,
4+
[programmeComponentId] [int] NOT NULL,
5+
[title] [nvarchar](256) NULL,
6+
[subject] [nvarchar](256) NOT NULL,
7+
[body] [ntext] NOT NULL,
8+
[deleted] [bit] NOT NULL,
9+
[amendUserID] [int] NOT NULL,
10+
[amendDate] [datetimeoffset](7) NOT NULL,
11+
[tenantId] [int] NULL,
12+
CONSTRAINT [PK_EmailTemplateTBL] PRIMARY KEY CLUSTERED
13+
(
14+
[emailTemplateId] ASC
15+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
16+
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
17+
GO
18+
19+
ALTER TABLE [dbo].[emailTemplateTBL] ADD CONSTRAINT [DF_emailTemplateTBL_Deleted] DEFAULT ((0)) FOR [deleted]
20+
GO
21+
22+
ALTER TABLE [dbo].[emailTemplateTBL] ADD CONSTRAINT [DF_EmailTemplate_AmendDate] DEFAULT (sysdatetimeoffset()) FOR [amendDate]
23+
GO
24+
25+
ALTER TABLE [dbo].[emailTemplateTBL] WITH CHECK ADD CONSTRAINT [FK_emailTemplateTBL_emailTemplateTypeTBL] FOREIGN KEY([emailTemplateTypeId])
26+
REFERENCES [dbo].[emailTemplateTypeTBL] ([emailTemplateTypeId])
27+
GO
28+
29+
ALTER TABLE [dbo].[emailTemplateTBL] CHECK CONSTRAINT [FK_emailTemplateTBL_emailTemplateTypeTBL]
30+
GO
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATE TABLE [dbo].[emailTemplateTypeTBL](
2+
[emailTemplateTypeId] [int] NOT NULL,
3+
[emailTemplateTypeName] [nvarchar](50) NOT NULL,
4+
[availableTags] [nvarchar](255) NULL,
5+
[deleted] [bit] NOT NULL,
6+
[amendUserID] [int] NOT NULL,
7+
[amendDate] [datetimeoffset](7) NOT NULL,
8+
CONSTRAINT [PK_emailTemplateTypeTBL] PRIMARY KEY CLUSTERED
9+
(
10+
[emailTemplateTypeId] 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 [dbo].[emailTemplateTypeTBL] ADD CONSTRAINT [DF_emailTemplateTypeTBL_Deleted] DEFAULT ((0)) FOR [deleted]
16+
GO
17+
18+
ALTER TABLE [dbo].[emailTemplateTypeTBL] ADD CONSTRAINT [DF_emailTemplateTypeTBL_AmendDate] DEFAULT (sysdatetimeoffset()) FOR [amendDate]
19+
GO
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
CREATE TABLE [dbo].[externalSystemTBL](
2+
[externalSystemId] [int] IDENTITY(1,1) NOT NULL,
3+
[externalSystemName] [nvarchar](50) NOT NULL,
4+
[url] [nvarchar](256) NULL,
5+
[tsAndCs] [nvarchar](max) NULL,
6+
[deleted] [bit] NOT NULL,
7+
[amendUserId] [int] NOT NULL,
8+
[amendUserDate] [datetimeoffset](7) NOT NULL,
9+
[securityGuid] [uniqueidentifier] NULL,
10+
[restrictToSSO] [bit] NOT NULL,
11+
[defaultUserGroupId] [int] NULL,
12+
[defaultStaffGroupId] [int] NULL,
13+
[defaultJobRoleId] [int] NULL,
14+
[defaultGradingId] [int] NULL,
15+
[defaultSpecialtyId] [int] NULL,
16+
[defaultLocationId] [int] NULL,
17+
[reportUserId] [int] NULL,
18+
[code] [nvarchar](50) NOT NULL,
19+
CONSTRAINT [PK_externalSystem] PRIMARY KEY CLUSTERED
20+
(
21+
[externalSystemId] ASC
22+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
23+
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
24+
GO
25+
26+
ALTER TABLE [dbo].[externalSystemTBL] ADD CONSTRAINT [DF_externalSystemTBL_RestrictToSSO] DEFAULT ((0)) FOR [restrictToSSO]
27+
GO
28+
29+
ALTER TABLE [dbo].[externalSystemTBL] ADD DEFAULT ('') FOR [code]
30+
GO
31+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
CREATE TABLE [dbo].[gdcRegisterTBL](
2+
[reg_number] [nvarchar](50) NOT NULL,
3+
[Dentist] [bit] NOT NULL,
4+
[Title] [nvarchar](50) NULL,
5+
[Surname] [nvarchar](255) NULL,
6+
[Forenames] [nvarchar](255) NULL,
7+
[honorifics] [nvarchar](50) NULL,
8+
[house_name] [nvarchar](255) NULL,
9+
[address_line1] [nvarchar](255) NULL,
10+
[address_line2] [nvarchar](255) NULL,
11+
[address_line3] [nvarchar](255) NULL,
12+
[address_line4] [nvarchar](255) NULL,
13+
[Town] [nvarchar](50) NULL,
14+
[County] [nvarchar](50) NULL,
15+
[PostCode] [nvarchar](50) NULL,
16+
[Country] [nvarchar](50) NULL,
17+
[regdate] [nvarchar](50) NULL,
18+
[qualifications] [nvarchar](1000) NULL,
19+
[dcp_titles] [nvarchar](100) NULL,
20+
[specialties] [nvarchar](100) NULL,
21+
[condition] [nvarchar](50) NULL,
22+
[suspension] [nvarchar](50) NULL,
23+
[dateProcessed] [datetimeoffset](7) NOT NULL,
24+
[action] [nvarchar](1) NULL,
25+
CONSTRAINT [PK_gdcRegisterTBL] PRIMARY KEY CLUSTERED
26+
(
27+
[reg_number] ASC
28+
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY]
29+
) ON [PRIMARY]
30+
GO
31+
32+
ALTER TABLE [dbo].[gdcRegisterTBL] ADD DEFAULT ((0)) FOR [Dentist]
33+
GO
34+
35+
ALTER TABLE [dbo].[gdcRegisterTBL] ADD DEFAULT (sysdatetimeoffset()) FOR [dateProcessed]
36+
GO

0 commit comments

Comments
 (0)