[성현모] UniqueKeyDB Scaffold 스크립트 추가, DLL 빌드 이벤트 배치로 변경
This commit is contained in:
@ -20,4 +20,4 @@ CALL _UpdateScriptGenerate.bat %Schema% %ServerIP% %ServerPort% %UserID% %Passwd
|
||||
|
||||
::Default DB
|
||||
::CALL _UpdateDB.bat %Schema% %ServerIP% %ServerPort% %UserID% %Passwd% %DBName%
|
||||
CALL _UpdateDB.bat %Schema% %ServerIP% %ServerPort% %UserID% %Passwd% %DBName%_DEV
|
||||
::CALL _UpdateDB.bat %Schema% %ServerIP% %ServerPort% %UserID% %Passwd% %DBName%_DEV
|
||||
@ -1,4 +1,4 @@
|
||||
::AccountDB
|
||||
cd ../SystemX.Core/SystemX.Core.DB
|
||||
cd ../Projects/SystemX.Core/SystemX.Core.DB
|
||||
|
||||
dotnet ef dbcontext scaffold "server=127.0.0.1; user id=SystemX; password=X; database=AccountDB; TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer --namespace SystemX.Core.DB --context-dir AccountDB\Context --output-dir AccountDB\Tables -f --use-database-names --no-onconfiguring
|
||||
4
DBPatch/Tool_UniqueKeyDB_Scaffold.bat
Normal file
4
DBPatch/Tool_UniqueKeyDB_Scaffold.bat
Normal file
@ -0,0 +1,4 @@
|
||||
::AccountDB
|
||||
cd ../Projects/SystemX.Core/SystemX.Core.DB
|
||||
|
||||
dotnet ef dbcontext scaffold "server=127.0.0.1; user id=SystemX; password=X; database=UniqueKeyDB; TrustServerCertificate=true;" Microsoft.EntityFrameworkCore.SqlServer --namespace SystemX.Core.DB --context-dir UniqueKeyDB\Context --output-dir UniqueKeyDB\Tables -f --use-database-names --no-onconfiguring
|
||||
@ -41,15 +41,6 @@ GO
|
||||
USE [$(DatabaseName)];
|
||||
|
||||
|
||||
GO
|
||||
PRINT N'테이블 [dbo].[tUser]을(를) 변경하는 중...';
|
||||
|
||||
|
||||
GO
|
||||
ALTER TABLE [dbo].[tUser]
|
||||
ADD [cUpdateTest] NCHAR (10) NULL;
|
||||
|
||||
|
||||
GO
|
||||
/*
|
||||
배포 후 스크립트 템플릿
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -21,7 +21,7 @@ public partial class AccountDBContext : DbContext
|
||||
{
|
||||
modelBuilder.Entity<tRefreshToken>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.cAuid).HasName("PK__tRefresh__FBF08554C9ECDB70");
|
||||
entity.HasKey(e => e.cAuid).HasName("PK__tRefresh__FBF08554FDACF5FE");
|
||||
|
||||
entity.ToTable("tRefreshToken");
|
||||
|
||||
@ -31,7 +31,7 @@ public partial class AccountDBContext : DbContext
|
||||
|
||||
modelBuilder.Entity<tRole>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.cAuid).HasName("PK__tRole__FBF0855413CC5A4E");
|
||||
entity.HasKey(e => e.cAuid).HasName("PK__tRole__FBF085542CB3B1D9");
|
||||
|
||||
entity.ToTable("tRole");
|
||||
|
||||
@ -41,7 +41,7 @@ public partial class AccountDBContext : DbContext
|
||||
|
||||
modelBuilder.Entity<tUser>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.cUserID).HasName("PK__tUser__A75DC19A4B18524F");
|
||||
entity.HasKey(e => e.cUserID).HasName("PK__tUser__A75DC19AC703F0FC");
|
||||
|
||||
entity.ToTable("tUser");
|
||||
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
::DLL복사
|
||||
xcopy /y /d .\bin\Debug\net8.0\SystemX.Core.DB.dll ..\..\DLL\
|
||||
@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -19,7 +20,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="xcopy /y $(ProjectDir)$(OutputPath)$(TargetName).dll $(SolutionDir)..\DLL\" />
|
||||
<Exec Command="call $(ProjectDir)AfterBuildScript.bat" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace SystemX.Core.DB;
|
||||
|
||||
public partial class UniqueKeyDBContext : DbContext
|
||||
{
|
||||
public UniqueKeyDBContext(DbContextOptions<UniqueKeyDBContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<tUniqueKeyStorage> tUniqueKeyStorages { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<tUniqueKeyStorage>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.cIdentity).HasName("PK__tUniqueK__3EBC650DADDCD506");
|
||||
|
||||
entity.ToTable("tUniqueKeyStorage");
|
||||
|
||||
entity.Property(e => e.cIdentity).HasMaxLength(200);
|
||||
entity.Property(e => e.cData1).HasMaxLength(4000);
|
||||
entity.Property(e => e.cData2).HasMaxLength(4000);
|
||||
entity.Property(e => e.cData3).HasMaxLength(4000);
|
||||
entity.Property(e => e.cData4).HasMaxLength(4000);
|
||||
entity.Property(e => e.cData5).HasMaxLength(4000);
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SystemX.Core.DB;
|
||||
|
||||
public partial class tUniqueKeyStorage
|
||||
{
|
||||
public string cIdentity { get; set; } = null!;
|
||||
|
||||
public DateTime cDateTime { get; set; }
|
||||
|
||||
public string? cData1 { get; set; }
|
||||
|
||||
public string? cData2 { get; set; }
|
||||
|
||||
public string? cData3 { get; set; }
|
||||
|
||||
public string? cData4 { get; set; }
|
||||
|
||||
public string? cData5 { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user