[성현모] UniqueKeyDB PairKey 테이블 추가
This commit is contained in:
@ -259,6 +259,22 @@ CREATE TABLE [dbo].[tUniqueKeyStorage] (
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
GO
|
||||||
|
PRINT N'테이블 [dbo].[tPairKeyStorage]을(를) 만드는 중...';
|
||||||
|
|
||||||
|
|
||||||
|
GO
|
||||||
|
CREATE TABLE [dbo].[tPairKeyStorage] (
|
||||||
|
[cPrimaryKey] NVARCHAR (50) NOT NULL,
|
||||||
|
[cSecondaryKey] NVARCHAR (50) NOT NULL,
|
||||||
|
[cValue1] NVARCHAR (200) NULL,
|
||||||
|
[cValue2] NVARCHAR (200) NULL,
|
||||||
|
[cDateTime] DATETIME2 (7) NOT NULL,
|
||||||
|
CONSTRAINT [PK_cProductKey] PRIMARY KEY CLUSTERED ([cPrimaryKey] ASC),
|
||||||
|
CONSTRAINT [UQ_cMacAddress] UNIQUE NONCLUSTERED ([cSecondaryKey] ASC)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
DECLARE @VarDecimalSupported AS BIT;
|
DECLARE @VarDecimalSupported AS BIT;
|
||||||
|
|
||||||
|
|||||||
@ -42,12 +42,19 @@ USE [$(DatabaseName)];
|
|||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
PRINT N'테이블 [dbo].[tUniqueKeyStorage]을(를) 변경하는 중...';
|
PRINT N'테이블 [dbo].[tPairKeyStorage]을(를) 만드는 중...';
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
ALTER TABLE [dbo].[tUniqueKeyStorage]
|
CREATE TABLE [dbo].[tPairKeyStorage] (
|
||||||
ADD [cData6] NCHAR (10) NULL;
|
[cPrimaryKey] NVARCHAR (50) NOT NULL,
|
||||||
|
[cSecondaryKey] NVARCHAR (50) NOT NULL,
|
||||||
|
[cValue1] NVARCHAR (200) NULL,
|
||||||
|
[cValue2] NVARCHAR (200) NULL,
|
||||||
|
[cDateTime] DATETIME2 (7) NOT NULL,
|
||||||
|
CONSTRAINT [PK_cProductKey] PRIMARY KEY CLUSTERED ([cPrimaryKey] ASC),
|
||||||
|
CONSTRAINT [UQ_cMacAddress] UNIQUE NONCLUSTERED ([cSecondaryKey] ASC)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -66,6 +66,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Build Include="dbo\Tables\tUniqueKeyStorage.sql" />
|
<Build Include="dbo\Tables\tUniqueKeyStorage.sql" />
|
||||||
|
<Build Include="dbo\Tables\tPairKeyStorage.sql" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>xcopy /y $(ProjectDir)$(OutputPath)$(TargetName)_Create.sql $(SolutionDir)..\..\DBPatch\sqlScripts\
|
<PostBuildEvent>xcopy /y $(ProjectDir)$(OutputPath)$(TargetName)_Create.sql $(SolutionDir)..\..\DBPatch\sqlScripts\
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
CREATE TABLE [dbo].[tPairKeyStorage]
|
||||||
|
(
|
||||||
|
[cPrimaryKey] NVARCHAR(50) NOT NULL,
|
||||||
|
[cSecondaryKey] NVARCHAR(50) NOT NULL,
|
||||||
|
[cValue1] NVARCHAR(200),
|
||||||
|
[cValue2] NVARCHAR(200),
|
||||||
|
[cDateTime] DATETIME2 NOT NULL,
|
||||||
|
|
||||||
|
CONSTRAINT PK_cProductKey PRIMARY KEY ([cPrimaryKey]),
|
||||||
|
CONSTRAINT UQ_cMacAddress UNIQUE ([cSecondaryKey]),
|
||||||
|
)
|
||||||
@ -209,7 +209,7 @@ namespace WebApi.Project.UniqueKeyApi.Services
|
|||||||
private UniqueKeyDBContext? GetUniqueKeyDBContext(DbContextProvider provider, int dbID)
|
private UniqueKeyDBContext? GetUniqueKeyDBContext(DbContextProvider provider, int dbID)
|
||||||
{
|
{
|
||||||
var connectionString = _configService?.GetConfig()?.DataBase?.Find(x => x.DBID == dbID);
|
var connectionString = _configService?.GetConfig()?.DataBase?.Find(x => x.DBID == dbID);
|
||||||
return provider?.GetDBContext<UniqueKeyDBContext>($"{connectionString?.DBID}");
|
return provider?.GetDBContext<UniqueKeyDBContext>((int)connectionString?.DBID);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user