Browse Source

update

集成Redis
wanggang 2 years ago
parent
commit
3e7dc27eb8
  1. 24
      be/Gateways/InternalGateway/InternalGateway.Host/InternalGateway.Host.csproj
  2. 99
      be/Gateways/InternalGateway/InternalGateway.Host/InternalGatewayHostModule.cs
  3. 12
      be/Gateways/InternalGateway/InternalGateway.Host/Program.cs
  4. 12
      be/Gateways/InternalGateway/InternalGateway.Host/Properties/launchSettings.json
  5. 9
      be/Gateways/InternalGateway/InternalGateway.Host/appsettings.Development.json
  6. 18
      be/Gateways/InternalGateway/InternalGateway.Host/appsettings.json
  7. 41
      be/Gateways/InternalGateway/InternalGateway.Host/ocelotsettings.json
  8. 25
      be/Gateways/InternalGateway/InternalGateway.sln
  9. 12
      be/Gateways/WebAppGateway/WebAppGateway.Host/Dockerfile
  10. 12
      be/Gateways/WebAppGateway/WebAppGateway.Host/Program.cs
  11. 17
      be/Gateways/WebAppGateway/WebAppGateway.Host/Properties/PublishProfiles/FolderProfile.pubxml
  12. 12
      be/Gateways/WebAppGateway/WebAppGateway.Host/Properties/launchSettings.json
  13. 35
      be/Gateways/WebAppGateway/WebAppGateway.Host/WebAppGateway.Host.csproj
  14. 112
      be/Gateways/WebAppGateway/WebAppGateway.Host/WebAppGatewayHostModule.cs
  15. 3
      be/Gateways/WebAppGateway/WebAppGateway.Host/appsettings.Development.json
  16. 4
      be/Gateways/WebAppGateway/WebAppGateway.Host/appsettings.Production.json
  17. 4
      be/Gateways/WebAppGateway/WebAppGateway.Host/appsettings.json
  18. 137
      be/Gateways/WebAppGateway/WebAppGateway.Host/ocelotsettings.json
  19. 25
      be/Gateways/WebAppGateway/WebAppGateway.sln
  20. 14
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs
  21. 2
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/Win_in.Sfs.Auth.Web.csproj
  22. 273
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.AuthDbContext.sql
  23. 28
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/scripts/db.Microsoft.EntityFrameworkCore.Sqlite.AuthDbContext.sql
  24. 839
      be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.AuthDbContext.sql
  25. 1073
      be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.BasedataDbContext.sql
  26. 97
      be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.FileStorageDbContext.sql
  27. 195
      be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.LabelDbContext.sql
  28. 145
      be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.MessageDbContext.sql
  29. 378
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.InventoryDbContext.sql
  30. 5691
      be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.StoreDbContext.sql
  31. 33
      be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs
  32. 8
      be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs
  33. 22
      be/WZC2.sln

24
be/Gateways/InternalGateway/InternalGateway.Host/InternalGateway.Host.csproj

@ -1,24 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>InternalGateway</RootNamespace>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.12" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.12" />
<PackageReference Include="Ocelot" Version="17.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="5.3.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Application\Win_in.Sfs.Shared.Application.csproj" />
<ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Host\Win_in.Sfs.Shared.Host.csproj" />
</ItemGroup>
</Project>

99
be/Gateways/InternalGateway/InternalGateway.Host/InternalGatewayHostModule.cs

@ -1,99 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
using Volo.Abp;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Identity;
using Volo.Abp.Modularity;
using Volo.Abp.Security.Claims;
using Win_in.Sfs.Shared.Host;
namespace InternalGateway;
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAspNetCoreSerilogModule)
)]
public class InternalGatewayHostModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
_ = context.Services.GetHostingEnvironment();
context.SetConsoleTitleOfWebApp("Internal.Gateway");
ConfigureAuthentication(context, configuration);
//ConfigureSql();
//ConfigureRedis(context, configuration, hostingEnvironment);
// ConfigureSwaggerServices(context);
context.Services.AddOcelot(context.Services.GetConfiguration());
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseCorrelationId();
app.UseRouting();
app.UseAuthentication();
//app.UseMultiTenancy();
//app.UseAuthorization();
app.Use(async (ctx, next) =>
{
var currentPrincipalAccessor = ctx.RequestServices.GetRequiredService<ICurrentPrincipalAccessor>();
var map = new Dictionary<string, string>()
{
{ "sub", AbpClaimTypes.UserId },
{ "role", AbpClaimTypes.Role },
{ "email", AbpClaimTypes.Email },
{ "name", AbpClaimTypes.UserName },
{ "tenantid", AbpClaimTypes.TenantId }
};
var mapClaims = currentPrincipalAccessor.Principal.Claims.Where(p => map.ContainsKey(p.Type)).ToList();
currentPrincipalAccessor.Principal.AddIdentity(new ClaimsIdentity(mapClaims.Select(p => new Claim(map[p.Type], p.Value, p.ValueType, p.Issuer))));
await next().ConfigureAwait(false);
});
// app.UseSwagger();
// app.UseSwaggerUI(options =>
// {
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "Business Service API");
// });
//
// app.MapWhen(
// ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") ||
// ctx.Request.Path.ToString().StartsWith("/Abp/"),
// app2 =>
// {
// app2.UseRouting();
// app2.UseConfiguredEndpoints();
// }
// );
app.UseOcelot().Wait();
app.UseAbpSerilogEnrichers();
}
private static void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
options.ApiName = "InternalGateway";
});
}
}

12
be/Gateways/InternalGateway/InternalGateway.Host/Program.cs

@ -1,12 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Win_in.Sfs.Shared.Host;
namespace InternalGateway;
public class Program
{
public static int Main(string[] args)
{
return WebApplication.CreateBuilder(args).BuildAndRun<InternalGatewayHostModule>();
}
}

12
be/Gateways/InternalGateway/InternalGateway.Host/Properties/launchSettings.json

@ -1,12 +0,0 @@
{
"profiles": {
"InternalGateway.Host": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:10020"
}
}
}

9
be/Gateways/InternalGateway/InternalGateway.Host/appsettings.Development.json

@ -1,9 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

18
be/Gateways/InternalGateway/InternalGateway.Host/appsettings.json

@ -1,18 +0,0 @@
{
"App": {
"CorsOrigins": [
"http://localhost:10000/"
]
},
"ConnectionStrings": {
"Default": "Server=localhost;Database=ABP;Trusted_Connection=True;"
},
"Redis": {
"Configuration": "dev.ccwin-in.com:16379"
},
"AuthServer": {
"Authority": "http://localhost:9096",
"ApiName": "InternalGateway"
},
"AllowedHosts": "*"
}

41
be/Gateways/InternalGateway/InternalGateway.Host/ocelotsettings.json

@ -1,41 +0,0 @@
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/identity/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.cd-top.com",
"Port": 9096
}
],
"UpstreamPathTemplate": "/api/identity/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/basedata/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.cd-top.com",
"Port": 9097
}
],
"UpstreamPathTemplate": "/api/basedata/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/wms/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.cd-top.com",
"Port": 9097
}
],
"UpstreamPathTemplate": "/api/wms/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
}
]
}

25
be/Gateways/InternalGateway/InternalGateway.sln

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternalGateway.Host", "InternalGateway.Host\InternalGateway.Host.csproj", "{C48F9300-FF79-4E66-9783-7E622FD0945A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C48F9300-FF79-4E66-9783-7E622FD0945A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C48F9300-FF79-4E66-9783-7E622FD0945A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C48F9300-FF79-4E66-9783-7E622FD0945A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C48F9300-FF79-4E66-9783-7E622FD0945A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {343C6B22-83EC-4A39-A731-1DD795BE7EF8}
EndGlobalSection
EndGlobal

12
be/Gateways/WebAppGateway/WebAppGateway.Host/Dockerfile

@ -1,12 +0,0 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /app
WORKDIR /src
COPY . .
RUN dotnet restore
RUN dotnet publish -c Release -o publish
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build /src/publish ./
ENTRYPOINT ["dotnet", "WebAppGateway.Host.dll"]

12
be/Gateways/WebAppGateway/WebAppGateway.Host/Program.cs

@ -1,12 +0,0 @@
using Microsoft.AspNetCore.Builder;
using Win_in.Sfs.Shared.Host;
namespace WebAppGateway;
public class Program
{
public static int Main(string[] args)
{
return WebApplication.CreateBuilder(args).BuildAndRun<WebAppGatewayHostModule>();
}
}

17
be/Gateways/WebAppGateway/WebAppGateway.Host/Properties/PublishProfiles/FolderProfile.pubxml

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<DeleteExistingFiles>true</DeleteExistingFiles>
<ExcludeApp_Data>false</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\Release\netcoreapp5\publish\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>

12
be/Gateways/WebAppGateway/WebAppGateway.Host/Properties/launchSettings.json

@ -1,12 +0,0 @@
{
"profiles": {
"WebAppGateway.Host": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:59099"
}
}
}

35
be/Gateways/WebAppGateway/WebAppGateway.Host/WebAppGateway.Host.csproj

@ -1,35 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>WebAppGateway</RootNamespace>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.12" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.12" />
<PackageReference Include="Ocelot" Version="17.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="5.3.5" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="5.3.5" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="5.3.5" />
<PackageReference Include="Volo.Abp.Identity.HttpApi" Version="5.3.5" />
<PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="5.3.5" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="5.3.5" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="5.3.5" />
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="5.3.5" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="5.3.5" />
<PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="5.3.5" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="5.3.5" />
<PackageReference Include="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="5.3.5" />
<PackageReference Include="Volo.Abp.TenantManagement.HttpApi" Version="5.3.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Application\Win_in.Sfs.Shared.Application.csproj" />
<ProjectReference Include="..\..\..\Modules\Shared\src\Win_in.Sfs.Shared.Host\Win_in.Sfs.Shared.Host.csproj" />
</ItemGroup>
</Project>

112
be/Gateways/WebAppGateway/WebAppGateway.Host/WebAppGatewayHostModule.cs

@ -1,112 +0,0 @@
using System;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
using Volo.Abp;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Win_in.Sfs.Shared.Host;
namespace WebAppGateway;
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpAspNetCoreSerilogModule)
)]
public class WebAppGatewayHostModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
_ = context.Services.GetHostingEnvironment();
context.SetConsoleTitleOfWebApp("Web.Gateway");
ConfigureAuthentication(context, configuration);
ConfigureCors(context, configuration);
//ConfigureSwaggerServices(context);
ConfigureLocalization();
context.Services.AddOcelot(context.Services.GetConfiguration());
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseCorrelationId();
app.UseRouting();
app.UseCors();
app.UseAuthentication();
app.UseAbpClaimsMap();
app.UseAuthorization();
//app.UseSwagger();
//app.UseSwaggerUI(options =>
//{
// options.SwaggerEndpoint("/swagger/v1/swagger.json", "Business Service API");
//});
app.UseOcelot().Wait();
app.UseAbpSerilogEnrichers();
}
private static void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAuthentication("Bearer")
.AddIdentityServerAuthentication(options =>
{
options.Authority = configuration["AuthServer:Authority"];
options.RequireHttpsMetadata = false;
options.ApiName = "WebAppGateway";
});
}
/*
private static void ConfigureSwaggerServices(ServiceConfigurationContext context)
{
context.Services.AddSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "WebAppGateway Service API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
});
}
*/
private void ConfigureLocalization()
{
Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
});
}
private static void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration)
{
var origins = configuration.GetSection("App:CorsOrigins").Get<string[]>();
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
origins.Select(o => o.RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
}
}

3
be/Gateways/WebAppGateway/WebAppGateway.Host/appsettings.Development.json

@ -1,3 +0,0 @@
{
"Urls": "http://localhost:59099"
}

4
be/Gateways/WebAppGateway/WebAppGateway.Host/appsettings.Production.json

@ -1,4 +0,0 @@
//{} -----
{
"Urls": "http://{应用地址}:59099"
}

4
be/Gateways/WebAppGateway/WebAppGateway.Host/appsettings.json

@ -1,4 +0,0 @@
{
}

137
be/Gateways/WebAppGateway/WebAppGateway.Host/ocelotsettings.json

@ -1,137 +0,0 @@
//dev.ccwin-in.com -----
{
"Routes": [
{
"DownstreamPathTemplate": "/api/abp/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59093
}
],
"UpstreamPathTemplate": "/api/abp/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/identity/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59093
}
],
"UpstreamPathTemplate": "/api/identity/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/base/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59093
}
],
"UpstreamPathTemplate": "/api/base/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/multi-tenancy/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59093
}
],
"UpstreamPathTemplate": "/api/multi-tenancy/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/permission-management/permissions",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59093
}
],
"UpstreamPathTemplate": "/api/permission-management/permissions",
"UpstreamHttpMethod": [ "Put", "Get" ]
},
{
"DownstreamPathTemplate": "/api/basedata/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59094
}
],
"UpstreamPathTemplate": "/api/basedata/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/wms/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59095
}
],
"UpstreamPathTemplate": "/api/wms/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/label/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59092
}
],
"UpstreamPathTemplate": "/api/label/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/filestore/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59092
}
],
"UpstreamPathTemplate": "/api/filestore/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/reporting/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59092
}
],
"UpstreamPathTemplate": "/api/reporting/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
},
{
"DownstreamPathTemplate": "/api/message/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "dev.ccwin-in.com",
"Port": 59092
}
],
"UpstreamPathTemplate": "/api/message/{everything}",
"UpstreamHttpMethod": [ "Put", "Delete", "Get", "Post" ]
}
]
}

25
be/Gateways/WebAppGateway/WebAppGateway.sln

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAppGateway.Host", "WebAppGateway.Host\WebAppGateway.Host.csproj", "{C27EC872-685A-43E2-8E8E-1C4B05B0B004}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C27EC872-685A-43E2-8E8E-1C4B05B0B004}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C27EC872-685A-43E2-8E8E-1C4B05B0B004}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C27EC872-685A-43E2-8E8E-1C4B05B0B004}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C27EC872-685A-43E2-8E8E-1C4B05B0B004}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {993A20BD-5184-407D-8874-270FC037FC57}
EndGlobalSection
EndGlobal

14
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs

@ -53,6 +53,20 @@ public class TokenService : ApplicationService
result.RefreshToken,
result.Scope });
}
[HttpGet("[action]")]
[AllowAnonymous]
public string Test()
{
return "Test";
}
[HttpGet("/token/test")]
[AllowAnonymous]
public string Test1()
{
return "Test";
}
}
[Display]

2
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/Win_in.Sfs.Auth.Web.csproj

@ -14,7 +14,7 @@
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>Win_in.Sfs.Auth-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
<IncrementVersionOnBuild>1.yyyy.Mdd.Hmm</IncrementVersionOnBuild>
<Version>1.2023.324.1018</Version>
<Version>1.2023.324.1632</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

273
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.AuthDbContext.sql

@ -24,8 +24,7 @@ CREATE TABLE [AbpAuditLogs] (
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
CONSTRAINT [PK_AbpAuditLogs] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpBackgroundJobs] (
@ -41,8 +40,7 @@ CREATE TABLE [AbpBackgroundJobs] (
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
CONSTRAINT [PK_AbpBackgroundJobs] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpClaimTypes] (
@ -57,8 +55,7 @@ CREATE TABLE [AbpClaimTypes] (
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
CONSTRAINT [PK_AbpClaimTypes] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpFeatureValues] (
@ -68,8 +65,7 @@ CREATE TABLE [AbpFeatureValues] (
[ProviderName] nvarchar(64) NULL,
[ProviderKey] nvarchar(64) NULL,
CONSTRAINT [PK_AbpFeatureValues] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpLinkUsers] (
@ -79,8 +75,7 @@ CREATE TABLE [AbpLinkUsers] (
[TargetUserId] uniqueidentifier NOT NULL,
[TargetTenantId] uniqueidentifier NULL,
CONSTRAINT [PK_AbpLinkUsers] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpOrganizationUnits] (
@ -100,8 +95,7 @@ CREATE TABLE [AbpOrganizationUnits] (
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_AbpOrganizationUnits] PRIMARY KEY ([Id]),
CONSTRAINT [FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId] FOREIGN KEY ([ParentId]) REFERENCES [AbpOrganizationUnits] ([Id])
);
GO
)
CREATE TABLE [AbpPermissionGrants] (
@ -111,8 +105,7 @@ CREATE TABLE [AbpPermissionGrants] (
[ProviderName] nvarchar(64) NOT NULL,
[ProviderKey] nvarchar(64) NOT NULL,
CONSTRAINT [PK_AbpPermissionGrants] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpRoles] (
@ -127,8 +120,7 @@ CREATE TABLE [AbpRoles] (
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
CONSTRAINT [PK_AbpRoles] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpSecurityLogs] (
@ -148,8 +140,7 @@ CREATE TABLE [AbpSecurityLogs] (
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
CONSTRAINT [PK_AbpSecurityLogs] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpSettings] (
@ -159,8 +150,7 @@ CREATE TABLE [AbpSettings] (
[ProviderName] nvarchar(64) NULL,
[ProviderKey] nvarchar(64) NULL,
CONSTRAINT [PK_AbpSettings] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpTenants] (
@ -176,8 +166,7 @@ CREATE TABLE [AbpTenants] (
[DeleterId] uniqueidentifier NULL,
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_AbpTenants] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [AbpUsers] (
@ -211,8 +200,7 @@ CREATE TABLE [AbpUsers] (
[DeleterId] uniqueidentifier NULL,
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_AbpUsers] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [Auth_Department] (
@ -230,8 +218,7 @@ CREATE TABLE [Auth_Department] (
[TenantId] uniqueidentifier NULL,
[Remark] nvarchar(3072) NULL,
CONSTRAINT [PK_Auth_Department] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [Auth_Menu] (
@ -259,8 +246,7 @@ CREATE TABLE [Auth_Menu] (
[TenantId] uniqueidentifier NULL,
[Remark] nvarchar(3072) NULL,
CONSTRAINT [PK_Auth_Menu] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [Auth_UserMenu] (
@ -277,8 +263,7 @@ CREATE TABLE [Auth_UserMenu] (
[TenantId] uniqueidentifier NULL,
[Remark] nvarchar(3072) NULL,
CONSTRAINT [PK_Auth_UserMenu] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [Auth_UserWorkGroup] (
@ -294,8 +279,7 @@ CREATE TABLE [Auth_UserWorkGroup] (
[TenantId] uniqueidentifier NULL,
[Remark] nvarchar(3072) NULL,
CONSTRAINT [PK_Auth_UserWorkGroup] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [IdentityServerApiResources] (
@ -316,8 +300,7 @@ CREATE TABLE [IdentityServerApiResources] (
[DeleterId] uniqueidentifier NULL,
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_IdentityServerApiResources] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [IdentityServerApiScopes] (
@ -339,8 +322,7 @@ CREATE TABLE [IdentityServerApiScopes] (
[DeleterId] uniqueidentifier NULL,
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_IdentityServerApiScopes] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [IdentityServerClients] (
@ -394,8 +376,7 @@ CREATE TABLE [IdentityServerClients] (
[DeleterId] uniqueidentifier NULL,
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_IdentityServerClients] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [IdentityServerDeviceFlowCodes] (
@ -413,8 +394,7 @@ CREATE TABLE [IdentityServerDeviceFlowCodes] (
[CreationTime] datetime2 NOT NULL,
[CreatorId] uniqueidentifier NULL,
CONSTRAINT [PK_IdentityServerDeviceFlowCodes] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [IdentityServerIdentityResources] (
@ -436,8 +416,7 @@ CREATE TABLE [IdentityServerIdentityResources] (
[DeleterId] uniqueidentifier NULL,
[DeletionTime] datetime2 NULL,
CONSTRAINT [PK_IdentityServerIdentityResources] PRIMARY KEY ([Id])
);
GO
)
CREATE TABLE [IdentityServerPersistedGrants] (
@ -455,8 +434,7 @@ CREATE TABLE [IdentityServerPersistedGrants] (
[ExtraProperties] nvarchar(max) NULL,
[ConcurrencyStamp] nvarchar(40) NULL,
CONSTRAINT [PK_IdentityServerPersistedGrants] PRIMARY KEY ([Key])
);
GO
)
CREATE TABLE [AbpAuditLogActions] (
@ -471,8 +449,7 @@ CREATE TABLE [AbpAuditLogActions] (
[ExtraProperties] nvarchar(max) NULL,
CONSTRAINT [PK_AbpAuditLogActions] PRIMARY KEY ([Id]),
CONSTRAINT [FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId] FOREIGN KEY ([AuditLogId]) REFERENCES [AbpAuditLogs] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpEntityChanges] (
@ -487,8 +464,7 @@ CREATE TABLE [AbpEntityChanges] (
[ExtraProperties] nvarchar(max) NULL,
CONSTRAINT [PK_AbpEntityChanges] PRIMARY KEY ([Id]),
CONSTRAINT [FK_AbpEntityChanges_AbpAuditLogs_AuditLogId] FOREIGN KEY ([AuditLogId]) REFERENCES [AbpAuditLogs] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpOrganizationUnitRoles] (
@ -500,8 +476,7 @@ CREATE TABLE [AbpOrganizationUnitRoles] (
CONSTRAINT [PK_AbpOrganizationUnitRoles] PRIMARY KEY ([OrganizationUnitId], [RoleId]),
CONSTRAINT [FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId] FOREIGN KEY ([OrganizationUnitId]) REFERENCES [AbpOrganizationUnits] ([Id]) ON DELETE CASCADE,
CONSTRAINT [FK_AbpOrganizationUnitRoles_AbpRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [AbpRoles] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpRoleClaims] (
@ -512,8 +487,7 @@ CREATE TABLE [AbpRoleClaims] (
[ClaimValue] nvarchar(1024) NULL,
CONSTRAINT [PK_AbpRoleClaims] PRIMARY KEY ([Id]),
CONSTRAINT [FK_AbpRoleClaims_AbpRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [AbpRoles] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpTenantConnectionStrings] (
@ -522,8 +496,7 @@ CREATE TABLE [AbpTenantConnectionStrings] (
[Value] nvarchar(1024) NOT NULL,
CONSTRAINT [PK_AbpTenantConnectionStrings] PRIMARY KEY ([TenantId], [Name]),
CONSTRAINT [FK_AbpTenantConnectionStrings_AbpTenants_TenantId] FOREIGN KEY ([TenantId]) REFERENCES [AbpTenants] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpUserClaims] (
@ -534,8 +507,7 @@ CREATE TABLE [AbpUserClaims] (
[ClaimValue] nvarchar(1024) NULL,
CONSTRAINT [PK_AbpUserClaims] PRIMARY KEY ([Id]),
CONSTRAINT [FK_AbpUserClaims_AbpUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [AbpUsers] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpUserLogins] (
@ -546,8 +518,7 @@ CREATE TABLE [AbpUserLogins] (
[ProviderDisplayName] nvarchar(128) NULL,
CONSTRAINT [PK_AbpUserLogins] PRIMARY KEY ([UserId], [LoginProvider]),
CONSTRAINT [FK_AbpUserLogins_AbpUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [AbpUsers] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpUserOrganizationUnits] (
@ -559,8 +530,7 @@ CREATE TABLE [AbpUserOrganizationUnits] (
CONSTRAINT [PK_AbpUserOrganizationUnits] PRIMARY KEY ([OrganizationUnitId], [UserId]),
CONSTRAINT [FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId] FOREIGN KEY ([OrganizationUnitId]) REFERENCES [AbpOrganizationUnits] ([Id]) ON DELETE CASCADE,
CONSTRAINT [FK_AbpUserOrganizationUnits_AbpUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [AbpUsers] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpUserRoles] (
@ -570,8 +540,7 @@ CREATE TABLE [AbpUserRoles] (
CONSTRAINT [PK_AbpUserRoles] PRIMARY KEY ([UserId], [RoleId]),
CONSTRAINT [FK_AbpUserRoles_AbpRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [AbpRoles] ([Id]) ON DELETE CASCADE,
CONSTRAINT [FK_AbpUserRoles_AbpUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [AbpUsers] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpUserTokens] (
@ -582,8 +551,7 @@ CREATE TABLE [AbpUserTokens] (
[Value] nvarchar(max) NULL,
CONSTRAINT [PK_AbpUserTokens] PRIMARY KEY ([UserId], [LoginProvider], [Name]),
CONSTRAINT [FK_AbpUserTokens_AbpUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [AbpUsers] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerApiResourceClaims] (
@ -591,8 +559,7 @@ CREATE TABLE [IdentityServerApiResourceClaims] (
[ApiResourceId] uniqueidentifier NOT NULL,
CONSTRAINT [PK_IdentityServerApiResourceClaims] PRIMARY KEY ([ApiResourceId], [Type]),
CONSTRAINT [FK_IdentityServerApiResourceClaims_IdentityServerApiResources_ApiResourceId] FOREIGN KEY ([ApiResourceId]) REFERENCES [IdentityServerApiResources] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerApiResourceProperties] (
@ -601,8 +568,7 @@ CREATE TABLE [IdentityServerApiResourceProperties] (
[Value] nvarchar(2000) NOT NULL,
CONSTRAINT [PK_IdentityServerApiResourceProperties] PRIMARY KEY ([ApiResourceId], [Key], [Value]),
CONSTRAINT [FK_IdentityServerApiResourceProperties_IdentityServerApiResources_ApiResourceId] FOREIGN KEY ([ApiResourceId]) REFERENCES [IdentityServerApiResources] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerApiResourceScopes] (
@ -610,8 +576,7 @@ CREATE TABLE [IdentityServerApiResourceScopes] (
[Scope] nvarchar(200) NOT NULL,
CONSTRAINT [PK_IdentityServerApiResourceScopes] PRIMARY KEY ([ApiResourceId], [Scope]),
CONSTRAINT [FK_IdentityServerApiResourceScopes_IdentityServerApiResources_ApiResourceId] FOREIGN KEY ([ApiResourceId]) REFERENCES [IdentityServerApiResources] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerApiResourceSecrets] (
@ -622,8 +587,7 @@ CREATE TABLE [IdentityServerApiResourceSecrets] (
[Expiration] datetime2 NULL,
CONSTRAINT [PK_IdentityServerApiResourceSecrets] PRIMARY KEY ([ApiResourceId], [Type], [Value]),
CONSTRAINT [FK_IdentityServerApiResourceSecrets_IdentityServerApiResources_ApiResourceId] FOREIGN KEY ([ApiResourceId]) REFERENCES [IdentityServerApiResources] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerApiScopeClaims] (
@ -631,8 +595,7 @@ CREATE TABLE [IdentityServerApiScopeClaims] (
[ApiScopeId] uniqueidentifier NOT NULL,
CONSTRAINT [PK_IdentityServerApiScopeClaims] PRIMARY KEY ([ApiScopeId], [Type]),
CONSTRAINT [FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiScopeId] FOREIGN KEY ([ApiScopeId]) REFERENCES [IdentityServerApiScopes] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerApiScopeProperties] (
@ -641,8 +604,7 @@ CREATE TABLE [IdentityServerApiScopeProperties] (
[Value] nvarchar(2000) NOT NULL,
CONSTRAINT [PK_IdentityServerApiScopeProperties] PRIMARY KEY ([ApiScopeId], [Key], [Value]),
CONSTRAINT [FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_ApiScopeId] FOREIGN KEY ([ApiScopeId]) REFERENCES [IdentityServerApiScopes] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientClaims] (
@ -651,8 +613,7 @@ CREATE TABLE [IdentityServerClientClaims] (
[Value] nvarchar(250) NOT NULL,
CONSTRAINT [PK_IdentityServerClientClaims] PRIMARY KEY ([ClientId], [Type], [Value]),
CONSTRAINT [FK_IdentityServerClientClaims_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientCorsOrigins] (
@ -660,8 +621,7 @@ CREATE TABLE [IdentityServerClientCorsOrigins] (
[Origin] nvarchar(150) NOT NULL,
CONSTRAINT [PK_IdentityServerClientCorsOrigins] PRIMARY KEY ([ClientId], [Origin]),
CONSTRAINT [FK_IdentityServerClientCorsOrigins_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientGrantTypes] (
@ -669,8 +629,7 @@ CREATE TABLE [IdentityServerClientGrantTypes] (
[GrantType] nvarchar(250) NOT NULL,
CONSTRAINT [PK_IdentityServerClientGrantTypes] PRIMARY KEY ([ClientId], [GrantType]),
CONSTRAINT [FK_IdentityServerClientGrantTypes_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientIdPRestrictions] (
@ -678,8 +637,7 @@ CREATE TABLE [IdentityServerClientIdPRestrictions] (
[Provider] nvarchar(200) NOT NULL,
CONSTRAINT [PK_IdentityServerClientIdPRestrictions] PRIMARY KEY ([ClientId], [Provider]),
CONSTRAINT [FK_IdentityServerClientIdPRestrictions_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientPostLogoutRedirectUris] (
@ -687,8 +645,7 @@ CREATE TABLE [IdentityServerClientPostLogoutRedirectUris] (
[PostLogoutRedirectUri] nvarchar(2000) NOT NULL,
CONSTRAINT [PK_IdentityServerClientPostLogoutRedirectUris] PRIMARY KEY ([ClientId], [PostLogoutRedirectUri]),
CONSTRAINT [FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientProperties] (
@ -697,8 +654,7 @@ CREATE TABLE [IdentityServerClientProperties] (
[Value] nvarchar(2000) NOT NULL,
CONSTRAINT [PK_IdentityServerClientProperties] PRIMARY KEY ([ClientId], [Key], [Value]),
CONSTRAINT [FK_IdentityServerClientProperties_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientRedirectUris] (
@ -706,8 +662,7 @@ CREATE TABLE [IdentityServerClientRedirectUris] (
[RedirectUri] nvarchar(2000) NOT NULL,
CONSTRAINT [PK_IdentityServerClientRedirectUris] PRIMARY KEY ([ClientId], [RedirectUri]),
CONSTRAINT [FK_IdentityServerClientRedirectUris_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientScopes] (
@ -715,8 +670,7 @@ CREATE TABLE [IdentityServerClientScopes] (
[Scope] nvarchar(200) NOT NULL,
CONSTRAINT [PK_IdentityServerClientScopes] PRIMARY KEY ([ClientId], [Scope]),
CONSTRAINT [FK_IdentityServerClientScopes_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerClientSecrets] (
@ -727,8 +681,7 @@ CREATE TABLE [IdentityServerClientSecrets] (
[Expiration] datetime2 NULL,
CONSTRAINT [PK_IdentityServerClientSecrets] PRIMARY KEY ([ClientId], [Type], [Value]),
CONSTRAINT [FK_IdentityServerClientSecrets_IdentityServerClients_ClientId] FOREIGN KEY ([ClientId]) REFERENCES [IdentityServerClients] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerIdentityResourceClaims] (
@ -736,8 +689,7 @@ CREATE TABLE [IdentityServerIdentityResourceClaims] (
[IdentityResourceId] uniqueidentifier NOT NULL,
CONSTRAINT [PK_IdentityServerIdentityResourceClaims] PRIMARY KEY ([IdentityResourceId], [Type]),
CONSTRAINT [FK_IdentityServerIdentityResourceClaims_IdentityServerIdentityResources_IdentityResourceId] FOREIGN KEY ([IdentityResourceId]) REFERENCES [IdentityServerIdentityResources] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [IdentityServerIdentityResourceProperties] (
@ -746,8 +698,7 @@ CREATE TABLE [IdentityServerIdentityResourceProperties] (
[Value] nvarchar(2000) NOT NULL,
CONSTRAINT [PK_IdentityServerIdentityResourceProperties] PRIMARY KEY ([IdentityResourceId], [Key], [Value]),
CONSTRAINT [FK_IdentityServerIdentityResourceProperties_IdentityServerIdentityResources_IdentityResourceId] FOREIGN KEY ([IdentityResourceId]) REFERENCES [IdentityServerIdentityResources] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE TABLE [AbpEntityPropertyChanges] (
@ -760,171 +711,129 @@ CREATE TABLE [AbpEntityPropertyChanges] (
[PropertyTypeFullName] nvarchar(64) NOT NULL,
CONSTRAINT [PK_AbpEntityPropertyChanges] PRIMARY KEY ([Id]),
CONSTRAINT [FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId] FOREIGN KEY ([EntityChangeId]) REFERENCES [AbpEntityChanges] ([Id]) ON DELETE CASCADE
);
GO
)
CREATE INDEX [IX_AbpAuditLogActions_AuditLogId] ON [AbpAuditLogActions] ([AuditLogId]);
GO
CREATE INDEX [IX_AbpAuditLogActions_AuditLogId] ON [AbpAuditLogActions] ([AuditLogId])
CREATE INDEX [IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime] ON [AbpAuditLogActions] ([TenantId], [ServiceName], [MethodName], [ExecutionTime]);
GO
CREATE INDEX [IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime] ON [AbpAuditLogActions] ([TenantId], [ServiceName], [MethodName], [ExecutionTime])
CREATE INDEX [IX_AbpAuditLogs_TenantId_ExecutionTime] ON [AbpAuditLogs] ([TenantId], [ExecutionTime]);
GO
CREATE INDEX [IX_AbpAuditLogs_TenantId_ExecutionTime] ON [AbpAuditLogs] ([TenantId], [ExecutionTime])
CREATE INDEX [IX_AbpAuditLogs_TenantId_UserId_ExecutionTime] ON [AbpAuditLogs] ([TenantId], [UserId], [ExecutionTime]);
GO
CREATE INDEX [IX_AbpAuditLogs_TenantId_UserId_ExecutionTime] ON [AbpAuditLogs] ([TenantId], [UserId], [ExecutionTime])
CREATE INDEX [IX_AbpBackgroundJobs_IsAbandoned_NextTryTime] ON [AbpBackgroundJobs] ([IsAbandoned], [NextTryTime]);
GO
CREATE INDEX [IX_AbpBackgroundJobs_IsAbandoned_NextTryTime] ON [AbpBackgroundJobs] ([IsAbandoned], [NextTryTime])
CREATE INDEX [IX_AbpEntityChanges_AuditLogId] ON [AbpEntityChanges] ([AuditLogId]);
GO
CREATE INDEX [IX_AbpEntityChanges_AuditLogId] ON [AbpEntityChanges] ([AuditLogId])
CREATE INDEX [IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId] ON [AbpEntityChanges] ([TenantId], [EntityTypeFullName], [EntityId]);
GO
CREATE INDEX [IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId] ON [AbpEntityChanges] ([TenantId], [EntityTypeFullName], [EntityId])
CREATE INDEX [IX_AbpEntityPropertyChanges_EntityChangeId] ON [AbpEntityPropertyChanges] ([EntityChangeId]);
GO
CREATE INDEX [IX_AbpEntityPropertyChanges_EntityChangeId] ON [AbpEntityPropertyChanges] ([EntityChangeId])
CREATE UNIQUE INDEX [IX_AbpFeatureValues_Name_ProviderName_ProviderKey] ON [AbpFeatureValues] ([Name], [ProviderName], [ProviderKey]) WHERE [ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL;
GO
CREATE UNIQUE INDEX [IX_AbpFeatureValues_Name_ProviderName_ProviderKey] ON [AbpFeatureValues] ([Name], [ProviderName], [ProviderKey]) WHERE [ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL
CREATE UNIQUE INDEX [IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_TargetTenantId] ON [AbpLinkUsers] ([SourceUserId], [SourceTenantId], [TargetUserId], [TargetTenantId]) WHERE [SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL;
GO
CREATE UNIQUE INDEX [IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_TargetTenantId] ON [AbpLinkUsers] ([SourceUserId], [SourceTenantId], [TargetUserId], [TargetTenantId]) WHERE [SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL
CREATE INDEX [IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId] ON [AbpOrganizationUnitRoles] ([RoleId], [OrganizationUnitId]);
GO
CREATE INDEX [IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId] ON [AbpOrganizationUnitRoles] ([RoleId], [OrganizationUnitId])
CREATE INDEX [IX_AbpOrganizationUnits_Code] ON [AbpOrganizationUnits] ([Code]);
GO
CREATE INDEX [IX_AbpOrganizationUnits_Code] ON [AbpOrganizationUnits] ([Code])
CREATE INDEX [IX_AbpOrganizationUnits_ParentId] ON [AbpOrganizationUnits] ([ParentId]);
GO
CREATE INDEX [IX_AbpOrganizationUnits_ParentId] ON [AbpOrganizationUnits] ([ParentId])
CREATE UNIQUE INDEX [IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey] ON [AbpPermissionGrants] ([TenantId], [Name], [ProviderName], [ProviderKey]) WHERE [TenantId] IS NOT NULL;
GO
CREATE UNIQUE INDEX [IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey] ON [AbpPermissionGrants] ([TenantId], [Name], [ProviderName], [ProviderKey]) WHERE [TenantId] IS NOT NULL
CREATE INDEX [IX_AbpRoleClaims_RoleId] ON [AbpRoleClaims] ([RoleId]);
GO
CREATE INDEX [IX_AbpRoleClaims_RoleId] ON [AbpRoleClaims] ([RoleId])
CREATE INDEX [IX_AbpRoles_NormalizedName] ON [AbpRoles] ([NormalizedName]);
GO
CREATE INDEX [IX_AbpRoles_NormalizedName] ON [AbpRoles] ([NormalizedName])
CREATE INDEX [IX_AbpSecurityLogs_TenantId_Action] ON [AbpSecurityLogs] ([TenantId], [Action]);
GO
CREATE INDEX [IX_AbpSecurityLogs_TenantId_Action] ON [AbpSecurityLogs] ([TenantId], [Action])
CREATE INDEX [IX_AbpSecurityLogs_TenantId_ApplicationName] ON [AbpSecurityLogs] ([TenantId], [ApplicationName]);
GO
CREATE INDEX [IX_AbpSecurityLogs_TenantId_ApplicationName] ON [AbpSecurityLogs] ([TenantId], [ApplicationName])
CREATE INDEX [IX_AbpSecurityLogs_TenantId_Identity] ON [AbpSecurityLogs] ([TenantId], [Identity]);
GO
CREATE INDEX [IX_AbpSecurityLogs_TenantId_Identity] ON [AbpSecurityLogs] ([TenantId], [Identity])
CREATE INDEX [IX_AbpSecurityLogs_TenantId_UserId] ON [AbpSecurityLogs] ([TenantId], [UserId]);
GO
CREATE INDEX [IX_AbpSecurityLogs_TenantId_UserId] ON [AbpSecurityLogs] ([TenantId], [UserId])
CREATE UNIQUE INDEX [IX_AbpSettings_Name_ProviderName_ProviderKey] ON [AbpSettings] ([Name], [ProviderName], [ProviderKey]) WHERE [ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL;
GO
CREATE UNIQUE INDEX [IX_AbpSettings_Name_ProviderName_ProviderKey] ON [AbpSettings] ([Name], [ProviderName], [ProviderKey]) WHERE [ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL
CREATE INDEX [IX_AbpTenants_Name] ON [AbpTenants] ([Name]);
GO
CREATE INDEX [IX_AbpTenants_Name] ON [AbpTenants] ([Name])
CREATE INDEX [IX_AbpUserClaims_UserId] ON [AbpUserClaims] ([UserId]);
GO
CREATE INDEX [IX_AbpUserClaims_UserId] ON [AbpUserClaims] ([UserId])
CREATE INDEX [IX_AbpUserLogins_LoginProvider_ProviderKey] ON [AbpUserLogins] ([LoginProvider], [ProviderKey]);
GO
CREATE INDEX [IX_AbpUserLogins_LoginProvider_ProviderKey] ON [AbpUserLogins] ([LoginProvider], [ProviderKey])
CREATE INDEX [IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId] ON [AbpUserOrganizationUnits] ([UserId], [OrganizationUnitId]);
GO
CREATE INDEX [IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId] ON [AbpUserOrganizationUnits] ([UserId], [OrganizationUnitId])
CREATE INDEX [IX_AbpUserRoles_RoleId_UserId] ON [AbpUserRoles] ([RoleId], [UserId]);
GO
CREATE INDEX [IX_AbpUserRoles_RoleId_UserId] ON [AbpUserRoles] ([RoleId], [UserId])
CREATE INDEX [IX_AbpUsers_Email] ON [AbpUsers] ([Email]);
GO
CREATE INDEX [IX_AbpUsers_Email] ON [AbpUsers] ([Email])
CREATE INDEX [IX_AbpUsers_NormalizedEmail] ON [AbpUsers] ([NormalizedEmail]);
GO
CREATE INDEX [IX_AbpUsers_NormalizedEmail] ON [AbpUsers] ([NormalizedEmail])
CREATE INDEX [IX_AbpUsers_NormalizedUserName] ON [AbpUsers] ([NormalizedUserName]);
GO
CREATE INDEX [IX_AbpUsers_NormalizedUserName] ON [AbpUsers] ([NormalizedUserName])
CREATE INDEX [IX_AbpUsers_UserName] ON [AbpUsers] ([UserName]);
GO
CREATE INDEX [IX_AbpUsers_UserName] ON [AbpUsers] ([UserName])
CREATE UNIQUE INDEX [IX_Auth_Department_Code] ON [Auth_Department] ([Code]);
GO
CREATE UNIQUE INDEX [IX_Auth_Department_Code] ON [Auth_Department] ([Code])
CREATE UNIQUE INDEX [IX_Auth_Menu_Code] ON [Auth_Menu] ([Code]);
GO
CREATE UNIQUE INDEX [IX_Auth_Menu_Code] ON [Auth_Menu] ([Code])
CREATE UNIQUE INDEX [IX_Auth_UserMenu_UserId_MenuCode] ON [Auth_UserMenu] ([UserId], [MenuCode]);
GO
CREATE UNIQUE INDEX [IX_Auth_UserMenu_UserId_MenuCode] ON [Auth_UserMenu] ([UserId], [MenuCode])
CREATE UNIQUE INDEX [IX_Auth_UserWorkGroup_WorkGroupCode_UserId] ON [Auth_UserWorkGroup] ([WorkGroupCode], [UserId]);
GO
CREATE UNIQUE INDEX [IX_Auth_UserWorkGroup_WorkGroupCode_UserId] ON [Auth_UserWorkGroup] ([WorkGroupCode], [UserId])
CREATE INDEX [IX_IdentityServerClients_ClientId] ON [IdentityServerClients] ([ClientId]);
GO
CREATE INDEX [IX_IdentityServerClients_ClientId] ON [IdentityServerClients] ([ClientId])
CREATE UNIQUE INDEX [IX_IdentityServerDeviceFlowCodes_DeviceCode] ON [IdentityServerDeviceFlowCodes] ([DeviceCode]);
GO
CREATE UNIQUE INDEX [IX_IdentityServerDeviceFlowCodes_DeviceCode] ON [IdentityServerDeviceFlowCodes] ([DeviceCode])
CREATE INDEX [IX_IdentityServerDeviceFlowCodes_Expiration] ON [IdentityServerDeviceFlowCodes] ([Expiration]);
GO
CREATE INDEX [IX_IdentityServerDeviceFlowCodes_Expiration] ON [IdentityServerDeviceFlowCodes] ([Expiration])
CREATE INDEX [IX_IdentityServerDeviceFlowCodes_UserCode] ON [IdentityServerDeviceFlowCodes] ([UserCode]);
GO
CREATE INDEX [IX_IdentityServerDeviceFlowCodes_UserCode] ON [IdentityServerDeviceFlowCodes] ([UserCode])
CREATE INDEX [IX_IdentityServerPersistedGrants_Expiration] ON [IdentityServerPersistedGrants] ([Expiration]);
GO
CREATE INDEX [IX_IdentityServerPersistedGrants_Expiration] ON [IdentityServerPersistedGrants] ([Expiration])
CREATE INDEX [IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type] ON [IdentityServerPersistedGrants] ([SubjectId], [ClientId], [Type]);
GO
CREATE INDEX [IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type] ON [IdentityServerPersistedGrants] ([SubjectId], [ClientId], [Type])
CREATE INDEX [IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type] ON [IdentityServerPersistedGrants] ([SubjectId], [SessionId], [Type]);
GO
CREATE INDEX [IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type] ON [IdentityServerPersistedGrants] ([SubjectId], [SessionId], [Type])

28
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/scripts/db.Microsoft.EntityFrameworkCore.Sqlite.AuthDbContext.sql

@ -783,30 +783,4 @@ CREATE UNIQUE INDEX "IX_Auth_Department_Code" ON "Auth_Department" ("Code");
CREATE UNIQUE INDEX "IX_Auth_Menu_Code" ON "Auth_Menu" ("Code");
CREATE UNIQUE INDEX "IX_Auth_UserMenu_UserId_MenuCode" ON "Auth_UserMenu" ("UserId", "MenuCode");
CREATE UNIQUE INDEX "IX_Auth_UserWorkGroup_WorkGroupCode_UserId" ON "Auth_UserWorkGroup" ("WorkGroupCode", "UserId");
CREATE INDEX "IX_IdentityServerClients_ClientId" ON "IdentityServerClients" ("ClientId");
CREATE UNIQUE INDEX "IX_IdentityServerDeviceFlowCodes_DeviceCode" ON "IdentityServerDeviceFlowCodes" ("DeviceCode");
CREATE INDEX "IX_IdentityServerDeviceFlowCodes_Expiration" ON "IdentityServerDeviceFlowCodes" ("Expiration");
CREATE INDEX "IX_IdentityServerDeviceFlowCodes_UserCode" ON "IdentityServerDeviceFlowCodes" ("UserCode");
CREATE INDEX "IX_IdentityServerPersistedGrants_Expiration" ON "IdentityServerPersistedGrants" ("Expiration");
CREATE INDEX "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type" ON "IdentityServerPersistedGrants" ("SubjectId", "ClientId", "Type");
CREATE INDEX "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type" ON "IdentityServerPersistedGrants" ("SubjectId", "SessionId", "Type");
CREATE UNIQUE INDEX "IX_Auth_UserMenu_UserId_Men

839
be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.AuthDbContext.sql

@ -0,0 +1,839 @@
CREATE TABLE "AbpAuditLogs" (
"Id" uuid NOT NULL,
"ApplicationName" character varying(96) NULL,
"UserId" uuid NULL,
"UserName" character varying(256) NULL,
"TenantId" uuid NULL,
"TenantName" character varying(64) NULL,
"ImpersonatorUserId" uuid NULL,
"ImpersonatorUserName" character varying(256) NULL,
"ImpersonatorTenantId" uuid NULL,
"ImpersonatorTenantName" character varying(64) NULL,
"ExecutionTime" timestamp without time zone NOT NULL,
"ExecutionDuration" integer NOT NULL,
"ClientIpAddress" character varying(64) NULL,
"ClientName" character varying(128) NULL,
"ClientId" character varying(64) NULL,
"CorrelationId" character varying(64) NULL,
"BrowserInfo" character varying(512) NULL,
"HttpMethod" character varying(16) NULL,
"Url" character varying(256) NULL,
"Exceptions" text NULL,
"Comments" character varying(256) NULL,
"HttpStatusCode" integer NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpAuditLogs" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpBackgroundJobs" (
"Id" uuid NOT NULL,
"JobName" character varying(128) NOT NULL,
"JobArgs" character varying(1048576) NOT NULL,
"TryCount" smallint NOT NULL DEFAULT 0,
"CreationTime" timestamp without time zone NOT NULL,
"NextTryTime" timestamp without time zone NOT NULL,
"LastTryTime" timestamp without time zone NULL,
"IsAbandoned" boolean NOT NULL DEFAULT FALSE,
"Priority" smallint NOT NULL DEFAULT 15,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpBackgroundJobs" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpClaimTypes" (
"Id" uuid NOT NULL,
"Name" character varying(256) NOT NULL,
"Required" boolean NOT NULL,
"IsStatic" boolean NOT NULL,
"Regex" character varying(512) NULL,
"RegexDescription" character varying(128) NULL,
"Description" character varying(256) NULL,
"ValueType" integer NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpClaimTypes" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpFeatureValues" (
"Id" uuid NOT NULL,
"Name" character varying(128) NOT NULL,
"Value" character varying(128) NOT NULL,
"ProviderName" character varying(64) NULL,
"ProviderKey" character varying(64) NULL,
CONSTRAINT "PK_AbpFeatureValues" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpLinkUsers" (
"Id" uuid NOT NULL,
"SourceUserId" uuid NOT NULL,
"SourceTenantId" uuid NULL,
"TargetUserId" uuid NOT NULL,
"TargetTenantId" uuid NULL,
CONSTRAINT "PK_AbpLinkUsers" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpOrganizationUnits" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"ParentId" uuid NULL,
"Code" character varying(95) NOT NULL,
"DisplayName" character varying(128) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_AbpOrganizationUnits" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId" FOREIGN KEY ("ParentId") REFERENCES "AbpOrganizationUnits" ("Id")
);
CREATE TABLE "AbpPermissionGrants" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"Name" character varying(128) NOT NULL,
"ProviderName" character varying(64) NOT NULL,
"ProviderKey" character varying(64) NOT NULL,
CONSTRAINT "PK_AbpPermissionGrants" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpRoles" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"Name" character varying(256) NOT NULL,
"NormalizedName" character varying(256) NOT NULL,
"IsDefault" boolean NOT NULL,
"IsStatic" boolean NOT NULL,
"IsPublic" boolean NOT NULL,
"Description" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpRoles" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpSecurityLogs" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"ApplicationName" character varying(96) NULL,
"Identity" character varying(96) NULL,
"Action" character varying(96) NULL,
"UserId" uuid NULL,
"UserName" character varying(256) NULL,
"TenantName" character varying(64) NULL,
"ClientId" character varying(64) NULL,
"CorrelationId" character varying(64) NULL,
"ClientIpAddress" character varying(64) NULL,
"BrowserInfo" character varying(512) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpSecurityLogs" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpSettings" (
"Id" uuid NOT NULL,
"Name" character varying(128) NOT NULL,
"Value" character varying(2048) NOT NULL,
"ProviderName" character varying(64) NULL,
"ProviderKey" character varying(64) NULL,
CONSTRAINT "PK_AbpSettings" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpTenants" (
"Id" uuid NOT NULL,
"Name" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_AbpTenants" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpUsers" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"UserName" character varying(256) NOT NULL,
"NormalizedUserName" character varying(256) NOT NULL,
"Name" character varying(64) NULL,
"Surname" character varying(64) NULL,
"Email" character varying(256) NOT NULL,
"NormalizedEmail" character varying(256) NOT NULL,
"EmailConfirmed" boolean NOT NULL DEFAULT FALSE,
"PasswordHash" character varying(256) NULL,
"SecurityStamp" character varying(256) NOT NULL,
"IsExternal" boolean NOT NULL DEFAULT FALSE,
"PhoneNumber" character varying(16) NULL,
"PhoneNumberConfirmed" boolean NOT NULL DEFAULT FALSE,
"IsActive" boolean NOT NULL,
"TwoFactorEnabled" boolean NOT NULL DEFAULT FALSE,
"LockoutEnd" timestamp with time zone NULL,
"LockoutEnabled" boolean NOT NULL DEFAULT FALSE,
"AccessFailedCount" integer NOT NULL DEFAULT 0,
"DepartmentCode" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_AbpUsers" PRIMARY KEY ("Id")
);
CREATE TABLE "Auth_Department" (
"Id" uuid NOT NULL,
"Code" character varying(64) NOT NULL,
"Name" character varying(64) NULL,
"Description" character varying(1024) NULL,
"IsActive" boolean NOT NULL DEFAULT TRUE,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Auth_Department" PRIMARY KEY ("Id")
);
CREATE TABLE "Auth_Menu" (
"Id" uuid NOT NULL,
"Code" character varying(64) NOT NULL,
"Name" character varying(64) NOT NULL,
"Description" character varying(1024) NULL,
"Icon" character varying(64) NULL,
"Route" character varying(64) NULL,
"Status" character varying(64) NOT NULL DEFAULT 'Enable',
"Sort" integer NOT NULL,
"Portal" character varying(64) NOT NULL,
"ParentCode" character varying(64) NULL,
"Permission" character varying(64) NULL,
"Component" character varying(64) NULL,
"GroupName" character varying(1024) NULL,
"GroupSort" integer NOT NULL,
"CountUrl" text NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Auth_Menu" PRIMARY KEY ("Id")
);
CREATE TABLE "Auth_UserMenu" (
"Id" uuid NOT NULL,
"UserId" uuid NOT NULL,
"MenuCode" character varying(64) NOT NULL,
"Portal" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Auth_UserMenu" PRIMARY KEY ("Id")
);
CREATE TABLE "Auth_UserWorkGroup" (
"Id" uuid NOT NULL,
"UserId" uuid NOT NULL,
"WorkGroupCode" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Auth_UserWorkGroup" PRIMARY KEY ("Id")
);
CREATE TABLE "IdentityServerApiResources" (
"Id" uuid NOT NULL,
"Name" character varying(200) NOT NULL,
"DisplayName" character varying(200) NULL,
"Description" character varying(1000) NULL,
"Enabled" boolean NOT NULL,
"AllowedAccessTokenSigningAlgorithms" character varying(100) NULL,
"ShowInDiscoveryDocument" boolean NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_IdentityServerApiResources" PRIMARY KEY ("Id")
);
CREATE TABLE "IdentityServerApiScopes" (
"Id" uuid NOT NULL,
"Enabled" boolean NOT NULL,
"Name" character varying(200) NOT NULL,
"DisplayName" character varying(200) NULL,
"Description" character varying(1000) NULL,
"Required" boolean NOT NULL,
"Emphasize" boolean NOT NULL,
"ShowInDiscoveryDocument" boolean NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_IdentityServerApiScopes" PRIMARY KEY ("Id")
);
CREATE TABLE "IdentityServerClients" (
"Id" uuid NOT NULL,
"ClientId" character varying(200) NOT NULL,
"ClientName" character varying(200) NULL,
"Description" character varying(1000) NULL,
"ClientUri" character varying(2000) NULL,
"LogoUri" character varying(2000) NULL,
"Enabled" boolean NOT NULL,
"ProtocolType" character varying(200) NOT NULL,
"RequireClientSecret" boolean NOT NULL,
"RequireConsent" boolean NOT NULL,
"AllowRememberConsent" boolean NOT NULL,
"AlwaysIncludeUserClaimsInIdToken" boolean NOT NULL,
"RequirePkce" boolean NOT NULL,
"AllowPlainTextPkce" boolean NOT NULL,
"RequireRequestObject" boolean NOT NULL,
"AllowAccessTokensViaBrowser" boolean NOT NULL,
"FrontChannelLogoutUri" character varying(2000) NULL,
"FrontChannelLogoutSessionRequired" boolean NOT NULL,
"BackChannelLogoutUri" character varying(2000) NULL,
"BackChannelLogoutSessionRequired" boolean NOT NULL,
"AllowOfflineAccess" boolean NOT NULL,
"IdentityTokenLifetime" integer NOT NULL,
"AllowedIdentityTokenSigningAlgorithms" character varying(100) NULL,
"AccessTokenLifetime" integer NOT NULL,
"AuthorizationCodeLifetime" integer NOT NULL,
"ConsentLifetime" integer NULL,
"AbsoluteRefreshTokenLifetime" integer NOT NULL,
"SlidingRefreshTokenLifetime" integer NOT NULL,
"RefreshTokenUsage" integer NOT NULL,
"UpdateAccessTokenClaimsOnRefresh" boolean NOT NULL,
"RefreshTokenExpiration" integer NOT NULL,
"AccessTokenType" integer NOT NULL,
"EnableLocalLogin" boolean NOT NULL,
"IncludeJwtId" boolean NOT NULL,
"AlwaysSendClientClaims" boolean NOT NULL,
"ClientClaimsPrefix" character varying(200) NULL,
"PairWiseSubjectSalt" character varying(200) NULL,
"UserSsoLifetime" integer NULL,
"UserCodeType" character varying(100) NULL,
"DeviceCodeLifetime" integer NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_IdentityServerClients" PRIMARY KEY ("Id")
);
CREATE TABLE "IdentityServerDeviceFlowCodes" (
"Id" uuid NOT NULL,
"DeviceCode" character varying(200) NOT NULL,
"UserCode" character varying(200) NOT NULL,
"SubjectId" character varying(200) NULL,
"SessionId" character varying(100) NULL,
"ClientId" character varying(200) NOT NULL,
"Description" character varying(200) NULL,
"Expiration" timestamp without time zone NOT NULL,
"Data" character varying(50000) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
CONSTRAINT "PK_IdentityServerDeviceFlowCodes" PRIMARY KEY ("Id")
);
CREATE TABLE "IdentityServerIdentityResources" (
"Id" uuid NOT NULL,
"Name" character varying(200) NOT NULL,
"DisplayName" character varying(200) NULL,
"Description" character varying(1000) NULL,
"Enabled" boolean NOT NULL,
"Required" boolean NOT NULL,
"Emphasize" boolean NOT NULL,
"ShowInDiscoveryDocument" boolean NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"IsDeleted" boolean NOT NULL DEFAULT FALSE,
"DeleterId" uuid NULL,
"DeletionTime" timestamp without time zone NULL,
CONSTRAINT "PK_IdentityServerIdentityResources" PRIMARY KEY ("Id")
);
CREATE TABLE "IdentityServerPersistedGrants" (
"Key" character varying(200) NOT NULL,
"Type" character varying(50) NOT NULL,
"SubjectId" character varying(200) NULL,
"SessionId" character varying(100) NULL,
"ClientId" character varying(200) NOT NULL,
"Description" character varying(200) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"Expiration" timestamp without time zone NULL,
"ConsumedTime" timestamp without time zone NULL,
"Data" character varying(50000) NOT NULL,
"Id" uuid NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_IdentityServerPersistedGrants" PRIMARY KEY ("Key")
);
CREATE TABLE "AbpAuditLogActions" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"AuditLogId" uuid NOT NULL,
"ServiceName" character varying(256) NULL,
"MethodName" character varying(128) NULL,
"Parameters" character varying(2000) NULL,
"ExecutionTime" timestamp without time zone NOT NULL,
"ExecutionDuration" integer NOT NULL,
"ExtraProperties" text NULL,
CONSTRAINT "PK_AbpAuditLogActions" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId" FOREIGN KEY ("AuditLogId") REFERENCES "AbpAuditLogs" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpEntityChanges" (
"Id" uuid NOT NULL,
"AuditLogId" uuid NOT NULL,
"TenantId" uuid NULL,
"ChangeTime" timestamp without time zone NOT NULL,
"ChangeType" smallint NOT NULL,
"EntityTenantId" uuid NULL,
"EntityId" character varying(128) NOT NULL,
"EntityTypeFullName" character varying(128) NOT NULL,
"ExtraProperties" text NULL,
CONSTRAINT "PK_AbpEntityChanges" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId" FOREIGN KEY ("AuditLogId") REFERENCES "AbpAuditLogs" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpOrganizationUnitRoles" (
"RoleId" uuid NOT NULL,
"OrganizationUnitId" uuid NOT NULL,
"TenantId" uuid NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
CONSTRAINT "PK_AbpOrganizationUnitRoles" PRIMARY KEY ("OrganizationUnitId", "RoleId"),
CONSTRAINT "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationU~" FOREIGN KEY ("OrganizationUnitId") REFERENCES "AbpOrganizationUnits" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId" FOREIGN KEY ("RoleId") REFERENCES "AbpRoles" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpRoleClaims" (
"Id" uuid NOT NULL,
"RoleId" uuid NOT NULL,
"TenantId" uuid NULL,
"ClaimType" character varying(256) NOT NULL,
"ClaimValue" character varying(1024) NULL,
CONSTRAINT "PK_AbpRoleClaims" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpRoleClaims_AbpRoles_RoleId" FOREIGN KEY ("RoleId") REFERENCES "AbpRoles" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpTenantConnectionStrings" (
"TenantId" uuid NOT NULL,
"Name" character varying(64) NOT NULL,
"Value" character varying(1024) NOT NULL,
CONSTRAINT "PK_AbpTenantConnectionStrings" PRIMARY KEY ("TenantId", "Name"),
CONSTRAINT "FK_AbpTenantConnectionStrings_AbpTenants_TenantId" FOREIGN KEY ("TenantId") REFERENCES "AbpTenants" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpUserClaims" (
"Id" uuid NOT NULL,
"UserId" uuid NOT NULL,
"TenantId" uuid NULL,
"ClaimType" character varying(256) NOT NULL,
"ClaimValue" character varying(1024) NULL,
CONSTRAINT "PK_AbpUserClaims" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpUserClaims_AbpUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AbpUsers" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpUserLogins" (
"UserId" uuid NOT NULL,
"LoginProvider" character varying(64) NOT NULL,
"TenantId" uuid NULL,
"ProviderKey" character varying(196) NOT NULL,
"ProviderDisplayName" character varying(128) NULL,
CONSTRAINT "PK_AbpUserLogins" PRIMARY KEY ("UserId", "LoginProvider"),
CONSTRAINT "FK_AbpUserLogins_AbpUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AbpUsers" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpUserOrganizationUnits" (
"UserId" uuid NOT NULL,
"OrganizationUnitId" uuid NOT NULL,
"TenantId" uuid NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
CONSTRAINT "PK_AbpUserOrganizationUnits" PRIMARY KEY ("OrganizationUnitId", "UserId"),
CONSTRAINT "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationU~" FOREIGN KEY ("OrganizationUnitId") REFERENCES "AbpOrganizationUnits" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_AbpUserOrganizationUnits_AbpUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AbpUsers" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpUserRoles" (
"UserId" uuid NOT NULL,
"RoleId" uuid NOT NULL,
"TenantId" uuid NULL,
CONSTRAINT "PK_AbpUserRoles" PRIMARY KEY ("UserId", "RoleId"),
CONSTRAINT "FK_AbpUserRoles_AbpRoles_RoleId" FOREIGN KEY ("RoleId") REFERENCES "AbpRoles" ("Id") ON DELETE CASCADE,
CONSTRAINT "FK_AbpUserRoles_AbpUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AbpUsers" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpUserTokens" (
"UserId" uuid NOT NULL,
"LoginProvider" character varying(64) NOT NULL,
"Name" character varying(128) NOT NULL,
"TenantId" uuid NULL,
"Value" text NULL,
CONSTRAINT "PK_AbpUserTokens" PRIMARY KEY ("UserId", "LoginProvider", "Name"),
CONSTRAINT "FK_AbpUserTokens_AbpUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AbpUsers" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerApiResourceClaims" (
"Type" character varying(200) NOT NULL,
"ApiResourceId" uuid NOT NULL,
CONSTRAINT "PK_IdentityServerApiResourceClaims" PRIMARY KEY ("ApiResourceId", "Type"),
CONSTRAINT "FK_IdentityServerApiResourceClaims_IdentityServerApiResources_~" FOREIGN KEY ("ApiResourceId") REFERENCES "IdentityServerApiResources" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerApiResourceProperties" (
"ApiResourceId" uuid NOT NULL,
"Key" character varying(250) NOT NULL,
"Value" character varying(2000) NOT NULL,
CONSTRAINT "PK_IdentityServerApiResourceProperties" PRIMARY KEY ("ApiResourceId", "Key", "Value"),
CONSTRAINT "FK_IdentityServerApiResourceProperties_IdentityServerApiResour~" FOREIGN KEY ("ApiResourceId") REFERENCES "IdentityServerApiResources" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerApiResourceScopes" (
"ApiResourceId" uuid NOT NULL,
"Scope" character varying(200) NOT NULL,
CONSTRAINT "PK_IdentityServerApiResourceScopes" PRIMARY KEY ("ApiResourceId", "Scope"),
CONSTRAINT "FK_IdentityServerApiResourceScopes_IdentityServerApiResources_~" FOREIGN KEY ("ApiResourceId") REFERENCES "IdentityServerApiResources" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerApiResourceSecrets" (
"Type" character varying(250) NOT NULL,
"Value" character varying(4000) NOT NULL,
"ApiResourceId" uuid NOT NULL,
"Description" character varying(1000) NULL,
"Expiration" timestamp without time zone NULL,
CONSTRAINT "PK_IdentityServerApiResourceSecrets" PRIMARY KEY ("ApiResourceId", "Type", "Value"),
CONSTRAINT "FK_IdentityServerApiResourceSecrets_IdentityServerApiResources~" FOREIGN KEY ("ApiResourceId") REFERENCES "IdentityServerApiResources" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerApiScopeClaims" (
"Type" character varying(200) NOT NULL,
"ApiScopeId" uuid NOT NULL,
CONSTRAINT "PK_IdentityServerApiScopeClaims" PRIMARY KEY ("ApiScopeId", "Type"),
CONSTRAINT "FK_IdentityServerApiScopeClaims_IdentityServerApiScopes_ApiSco~" FOREIGN KEY ("ApiScopeId") REFERENCES "IdentityServerApiScopes" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerApiScopeProperties" (
"ApiScopeId" uuid NOT NULL,
"Key" character varying(250) NOT NULL,
"Value" character varying(2000) NOT NULL,
CONSTRAINT "PK_IdentityServerApiScopeProperties" PRIMARY KEY ("ApiScopeId", "Key", "Value"),
CONSTRAINT "FK_IdentityServerApiScopeProperties_IdentityServerApiScopes_Ap~" FOREIGN KEY ("ApiScopeId") REFERENCES "IdentityServerApiScopes" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientClaims" (
"ClientId" uuid NOT NULL,
"Type" character varying(250) NOT NULL,
"Value" character varying(250) NOT NULL,
CONSTRAINT "PK_IdentityServerClientClaims" PRIMARY KEY ("ClientId", "Type", "Value"),
CONSTRAINT "FK_IdentityServerClientClaims_IdentityServerClients_ClientId" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientCorsOrigins" (
"ClientId" uuid NOT NULL,
"Origin" character varying(150) NOT NULL,
CONSTRAINT "PK_IdentityServerClientCorsOrigins" PRIMARY KEY ("ClientId", "Origin"),
CONSTRAINT "FK_IdentityServerClientCorsOrigins_IdentityServerClients_Clien~" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientGrantTypes" (
"ClientId" uuid NOT NULL,
"GrantType" character varying(250) NOT NULL,
CONSTRAINT "PK_IdentityServerClientGrantTypes" PRIMARY KEY ("ClientId", "GrantType"),
CONSTRAINT "FK_IdentityServerClientGrantTypes_IdentityServerClients_Client~" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientIdPRestrictions" (
"ClientId" uuid NOT NULL,
"Provider" character varying(200) NOT NULL,
CONSTRAINT "PK_IdentityServerClientIdPRestrictions" PRIMARY KEY ("ClientId", "Provider"),
CONSTRAINT "FK_IdentityServerClientIdPRestrictions_IdentityServerClients_C~" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientPostLogoutRedirectUris" (
"ClientId" uuid NOT NULL,
"PostLogoutRedirectUri" character varying(2000) NOT NULL,
CONSTRAINT "PK_IdentityServerClientPostLogoutRedirectUris" PRIMARY KEY ("ClientId", "PostLogoutRedirectUri"),
CONSTRAINT "FK_IdentityServerClientPostLogoutRedirectUris_IdentityServerCl~" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientProperties" (
"ClientId" uuid NOT NULL,
"Key" character varying(250) NOT NULL,
"Value" character varying(2000) NOT NULL,
CONSTRAINT "PK_IdentityServerClientProperties" PRIMARY KEY ("ClientId", "Key", "Value"),
CONSTRAINT "FK_IdentityServerClientProperties_IdentityServerClients_Client~" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientRedirectUris" (
"ClientId" uuid NOT NULL,
"RedirectUri" character varying(2000) NOT NULL,
CONSTRAINT "PK_IdentityServerClientRedirectUris" PRIMARY KEY ("ClientId", "RedirectUri"),
CONSTRAINT "FK_IdentityServerClientRedirectUris_IdentityServerClients_Clie~" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientScopes" (
"ClientId" uuid NOT NULL,
"Scope" character varying(200) NOT NULL,
CONSTRAINT "PK_IdentityServerClientScopes" PRIMARY KEY ("ClientId", "Scope"),
CONSTRAINT "FK_IdentityServerClientScopes_IdentityServerClients_ClientId" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerClientSecrets" (
"Type" character varying(250) NOT NULL,
"Value" character varying(4000) NOT NULL,
"ClientId" uuid NOT NULL,
"Description" character varying(2000) NULL,
"Expiration" timestamp without time zone NULL,
CONSTRAINT "PK_IdentityServerClientSecrets" PRIMARY KEY ("ClientId", "Type", "Value"),
CONSTRAINT "FK_IdentityServerClientSecrets_IdentityServerClients_ClientId" FOREIGN KEY ("ClientId") REFERENCES "IdentityServerClients" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerIdentityResourceClaims" (
"Type" character varying(200) NOT NULL,
"IdentityResourceId" uuid NOT NULL,
CONSTRAINT "PK_IdentityServerIdentityResourceClaims" PRIMARY KEY ("IdentityResourceId", "Type"),
CONSTRAINT "FK_IdentityServerIdentityResourceClaims_IdentityServerIdentity~" FOREIGN KEY ("IdentityResourceId") REFERENCES "IdentityServerIdentityResources" ("Id") ON DELETE CASCADE
);
CREATE TABLE "IdentityServerIdentityResourceProperties" (
"IdentityResourceId" uuid NOT NULL,
"Key" character varying(250) NOT NULL,
"Value" character varying(2000) NOT NULL,
CONSTRAINT "PK_IdentityServerIdentityResourceProperties" PRIMARY KEY ("IdentityResourceId", "Key", "Value"),
CONSTRAINT "FK_IdentityServerIdentityResourceProperties_IdentityServerIden~" FOREIGN KEY ("IdentityResourceId") REFERENCES "IdentityServerIdentityResources" ("Id") ON DELETE CASCADE
);
CREATE TABLE "AbpEntityPropertyChanges" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"EntityChangeId" uuid NOT NULL,
"NewValue" character varying(512) NULL,
"OriginalValue" character varying(512) NULL,
"PropertyName" character varying(128) NOT NULL,
"PropertyTypeFullName" character varying(64) NOT NULL,
CONSTRAINT "PK_AbpEntityPropertyChanges" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId" FOREIGN KEY ("EntityChangeId") REFERENCES "AbpEntityChanges" ("Id") ON DELETE CASCADE
);
CREATE INDEX "IX_AbpAuditLogActions_AuditLogId" ON "AbpAuditLogActions" ("AuditLogId");
CREATE INDEX "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Executio~" ON "AbpAuditLogActions" ("TenantId", "ServiceName", "MethodName", "ExecutionTime");
CREATE INDEX "IX_AbpAuditLogs_TenantId_ExecutionTime" ON "AbpAuditLogs" ("TenantId", "ExecutionTime");
CREATE INDEX "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime" ON "AbpAuditLogs" ("TenantId", "UserId", "ExecutionTime");
CREATE INDEX "IX_AbpBackgroundJobs_IsAbandoned_NextTryTime" ON "AbpBackgroundJobs" ("IsAbandoned", "NextTryTime");
CREATE INDEX "IX_AbpEntityChanges_AuditLogId" ON "AbpEntityChanges" ("AuditLogId");
CREATE INDEX "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId" ON "AbpEntityChanges" ("TenantId", "EntityTypeFullName", "EntityId");
CREATE INDEX "IX_AbpEntityPropertyChanges_EntityChangeId" ON "AbpEntityPropertyChanges" ("EntityChangeId");
CREATE UNIQUE INDEX "IX_AbpFeatureValues_Name_ProviderName_ProviderKey" ON "AbpFeatureValues" ("Name", "ProviderName", "ProviderKey");
CREATE UNIQUE INDEX "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_Targe~" ON "AbpLinkUsers" ("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId");
CREATE INDEX "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId" ON "AbpOrganizationUnitRoles" ("RoleId", "OrganizationUnitId");
CREATE INDEX "IX_AbpOrganizationUnits_Code" ON "AbpOrganizationUnits" ("Code");
CREATE INDEX "IX_AbpOrganizationUnits_ParentId" ON "AbpOrganizationUnits" ("ParentId");
CREATE UNIQUE INDEX "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey" ON "AbpPermissionGrants" ("TenantId", "Name", "ProviderName", "ProviderKey");
CREATE INDEX "IX_AbpRoleClaims_RoleId" ON "AbpRoleClaims" ("RoleId");
CREATE INDEX "IX_AbpRoles_NormalizedName" ON "AbpRoles" ("NormalizedName");
CREATE INDEX "IX_AbpSecurityLogs_TenantId_Action" ON "AbpSecurityLogs" ("TenantId", "Action");
CREATE INDEX "IX_AbpSecurityLogs_TenantId_ApplicationName" ON "AbpSecurityLogs" ("TenantId", "ApplicationName");
CREATE INDEX "IX_AbpSecurityLogs_TenantId_Identity" ON "AbpSecurityLogs" ("TenantId", "Identity");
CREATE INDEX "IX_AbpSecurityLogs_TenantId_UserId" ON "AbpSecurityLogs" ("TenantId", "UserId");
CREATE UNIQUE INDEX "IX_AbpSettings_Name_ProviderName_ProviderKey" ON "AbpSettings" ("Name", "ProviderName", "ProviderKey");
CREATE INDEX "IX_AbpTenants_Name" ON "AbpTenants" ("Name");
CREATE INDEX "IX_AbpUserClaims_UserId" ON "AbpUserClaims" ("UserId");
CREATE INDEX "IX_AbpUserLogins_LoginProvider_ProviderKey" ON "AbpUserLogins" ("LoginProvider", "ProviderKey");
CREATE INDEX "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId" ON "AbpUserOrganizationUnits" ("UserId", "OrganizationUnitId");
CREATE INDEX "IX_AbpUserRoles_RoleId_UserId" ON "AbpUserRoles" ("RoleId", "UserId");
CREATE INDEX "IX_AbpUsers_Email" ON "AbpUsers" ("Email");
CREATE INDEX "IX_AbpUsers_NormalizedEmail" ON "AbpUsers" ("NormalizedEmail");
CREATE INDEX "IX_AbpUsers_NormalizedUserName" ON "AbpUsers" ("NormalizedUserName");
CREATE INDEX "IX_AbpUsers_UserName" ON "AbpUsers" ("UserName");
CREATE UNIQUE INDEX "IX_Auth_Department_Code" ON "Auth_Department" ("Code");
CREATE UNIQUE INDEX "IX_Auth_Menu_Code" ON "Auth_Menu" ("Code");
CREATE UNIQUE INDEX "IX_Auth_UserMenu_UserId_MenuCode" ON "Auth_UserMenu" ("UserId", "MenuCode");
CREATE UNIQUE INDEX "IX_Auth_UserWorkGroup_WorkGroupCode_UserId" ON "Auth_UserWorkGroup" ("WorkGroupCode", "UserId");
CREATE INDEX "IX_IdentityServerClients_ClientId" ON "IdentityServerClients" ("ClientId");
CREATE UNIQUE INDEX "IX_IdentityServerDeviceFlowCodes_DeviceCode" ON "IdentityServerDeviceFlowCodes" ("DeviceCode");
CREATE INDEX "IX_IdentityServerDeviceFlowCodes_Expiration" ON "IdentityServerDeviceFlowCodes" ("Expiration");
CREATE INDEX "IX_IdentityServerDeviceFlowCodes_UserCode" ON "IdentityServerDeviceFlowCodes" ("UserCode");
CREATE INDEX "IX_IdentityServerPersistedGrants_Expiration" ON "IdentityServerPersistedGrants" ("Expiration");
CREATE INDEX "IX_IdentityServerPersistedGrants_SubjectId_ClientId_Type" ON "IdentityServerPersistedGrants" ("SubjectId", "ClientId", "Type");
CREATE INDEX "IX_IdentityServerPersistedGrants_SubjectId_SessionId_Type" ON "IdentityServerPersistedGrants" ("SubjectId", "SessionId", "Type");

1073
be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.BasedataDbContext.sql

File diff suppressed because it is too large

97
be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.FileStorageDbContext.sql

@ -0,0 +1,97 @@
CREATE TABLE "AbpBlobContainers" (
"Id" uuid NOT NULL,
"TenantId" uuid NULL,
"Name" character varying(128) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpBlobContainers" PRIMARY KEY ("Id")
);
CREATE TABLE "FileStorage_DataExportTask" (
"Id" uuid NOT NULL,
"ExportFileBlobName" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
"Function" character varying(64) NOT NULL,
"Route" character varying(64) NOT NULL,
"RequestParam" text NULL,
"ReturnResult" text NULL,
"Worker" character varying(64) NULL,
"BeginTime" timestamp without time zone NULL,
"EndTime" timestamp without time zone NULL,
"Status" character varying(64) NOT NULL,
CONSTRAINT "PK_FileStorage_DataExportTask" PRIMARY KEY ("Id")
);
CREATE TABLE "FileStorage_DataImportTask" (
"Id" uuid NOT NULL,
"ImportFileBlobName" character varying(64) NOT NULL,
"ImportReportBlobName" character varying(64) NULL,
"ImportStatus" integer NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
"Function" character varying(64) NOT NULL,
"Route" character varying(64) NOT NULL,
"RequestParam" text NULL,
"ReturnResult" text NULL,
"Worker" character varying(64) NULL,
"BeginTime" timestamp without time zone NULL,
"EndTime" timestamp without time zone NULL,
"Status" character varying(64) NOT NULL,
CONSTRAINT "PK_FileStorage_DataImportTask" PRIMARY KEY ("Id")
);
CREATE TABLE "FileStorage_File" (
"Id" uuid NOT NULL,
"FileName" character varying(1024) NOT NULL,
"BlobName" character varying(1024) NOT NULL,
"ByteSize" bigint NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" text NULL,
CONSTRAINT "PK_FileStorage_File" PRIMARY KEY ("Id")
);
CREATE TABLE "AbpBlobs" (
"Id" uuid NOT NULL,
"ContainerId" uuid NOT NULL,
"TenantId" uuid NULL,
"Name" character varying(256) NOT NULL,
"Content" bytea NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
CONSTRAINT "PK_AbpBlobs" PRIMARY KEY ("Id"),
CONSTRAINT "FK_AbpBlobs_AbpBlobContainers_ContainerId" FOREIGN KEY ("ContainerId") REFERENCES "AbpBlobContainers" ("Id") ON DELETE CASCADE
);
CREATE INDEX "IX_AbpBlobContainers_TenantId_Name" ON "AbpBlobContainers" ("TenantId", "Name");
CREATE INDEX "IX_AbpBlobs_ContainerId" ON "AbpBlobs" ("ContainerId");
CREATE INDEX "IX_AbpBlobs_TenantId_ContainerId_Name" ON "AbpBlobs" ("TenantId", "ContainerId", "Name");

195
be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.LabelDbContext.sql

@ -0,0 +1,195 @@
CREATE TABLE "Label_CountLabel" (
"Id" uuid NOT NULL,
"RuleCode" character varying(64) NOT NULL,
"CountNumber" integer NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_CountLabel" PRIMARY KEY ("Id")
);
CREATE TABLE "Label_InventoryLabel" (
"Id" uuid NOT NULL,
"Code" character varying(64) NOT NULL,
"LabelType" character varying(64) NOT NULL,
"FullBarcodeString" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"ItemName" text NULL,
"ItemDesc1" text NULL,
"ItemDesc2" text NULL,
"Lot" character varying(64) NOT NULL,
"SupplierBatch" text NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"StdPackQty" numeric(18,6) NOT NULL,
"Uom" character varying(64) NULL,
"Qty" numeric(18,6) NOT NULL,
"LabelStatus" character varying(64) NOT NULL,
"RecommendLocationCode" character varying(64) NULL,
"LocationErpCode" text NULL,
"ContainerCode" character varying(64) NULL,
"QualityInfo_QLevel" character varying(64) NULL,
"QualityInfo_QualityFile" character varying(64) NULL,
"PurchaseInfo_SupplierCode" character varying(64) NULL,
"PurchaseInfo_PoNumber" character varying(64) NULL,
"PurchaseInfo_RpNumber" character varying(64) NULL,
"PurchaseInfo_AsnNumber" character varying(64) NULL,
"ProductionInfo_ProdLine" character varying(64) NULL,
"ProductionInfo_Team" character varying(64) NULL,
"ProductionInfo_Shift" character varying(64) NULL,
"Specifications" text NULL,
"SupplierName" text NULL,
"SupplierSimpleName" text NULL,
"SupplierItemCode" text NULL,
"SupplierItemName" text NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_InventoryLabel" PRIMARY KEY ("Id")
);
CREATE TABLE "Label_LabelDefinition" (
"Id" uuid NOT NULL,
"Code" character varying(64) NOT NULL,
"Name" character varying(64) NULL,
"Description" character varying(1024) NULL,
"Type" character varying(64) NULL,
"Prefix" character varying(64) NULL,
"Format" character varying(64) NULL,
"SerialLength" integer NOT NULL,
"Separator" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_LabelDefinition" PRIMARY KEY ("Id")
);
CREATE TABLE "Label_PalletCode" (
"Id" uuid NOT NULL,
"RuleCode" character varying(64) NOT NULL,
"PalletlNumber" integer NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_PalletCode" PRIMARY KEY ("Id")
);
CREATE TABLE "Label_PalletLabel" (
"Id" uuid NOT NULL,
"Code" character varying(64) NOT NULL,
"LabelType" character varying(64) NOT NULL,
"LabelStatus" character varying(64) NOT NULL,
"HasItem" boolean NOT NULL,
"Name" text NULL,
"Desc1" text NULL,
"Desc2" text NULL,
"ParentId" uuid NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_PalletLabel" PRIMARY KEY ("Id")
);
CREATE TABLE "Label_SaleLabel" (
"Id" uuid NOT NULL,
"Code" character varying(64) NOT NULL,
"LabelType" character varying(64) NOT NULL,
"FullBarcodeString" character varying(64) NOT NULL,
"ItemCode" character varying(64) NOT NULL,
"ItemName" text NULL,
"ItemDesc1" text NULL,
"ItemDesc2" text NULL,
"Lot" character varying(64) NOT NULL,
"SupplierBatch" text NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"StdPackQty" numeric(18,6) NOT NULL,
"Uom" character varying(64) NULL,
"Qty" numeric(18,6) NOT NULL,
"LabelStatus" character varying(64) NOT NULL,
"DocumentCode" character varying(64) NOT NULL,
"ContainerCode" character varying(64) NOT NULL,
"SaleInfo_SaleInfoName" text NULL,
"QualityInfo_QLevel" character varying(64) NULL,
"QualityInfo_QualityFile" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_SaleLabel" PRIMARY KEY ("Id")
);
CREATE TABLE "Label_SerialCode" (
"Id" uuid NOT NULL,
"RuleCode" character varying(64) NOT NULL,
"SerialNumber" integer NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Label_SerialCode" PRIMARY KEY ("Id")
);
CREATE UNIQUE INDEX "IX_Label_CountLabel_RuleCode_CountNumber" ON "Label_CountLabel" ("RuleCode", "CountNumber");
CREATE UNIQUE INDEX "IX_Label_InventoryLabel_Code" ON "Label_InventoryLabel" ("Code");
CREATE UNIQUE INDEX "IX_Label_LabelDefinition_Code" ON "Label_LabelDefinition" ("Code");
CREATE UNIQUE INDEX "IX_Label_PalletCode_RuleCode_PalletlNumber" ON "Label_PalletCode" ("RuleCode", "PalletlNumber");
CREATE UNIQUE INDEX "IX_Label_PalletLabel_Code" ON "Label_PalletLabel" ("Code");
CREATE UNIQUE INDEX "IX_Label_SaleLabel_Code" ON "Label_SaleLabel" ("Code");
CREATE UNIQUE INDEX "IX_Label_SerialCode_RuleCode_SerialNumber" ON "Label_SerialCode" ("RuleCode", "SerialNumber");

145
be/Hosts/Core.Host/Win_in.Sfs.Core.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.MessageDbContext.sql

@ -0,0 +1,145 @@
CREATE TABLE "Message_Announcement" (
"Id" uuid NOT NULL,
"Title" character varying(64) NOT NULL,
"Brief" character varying(1024) NOT NULL,
"Content" character varying(3072) NULL,
"MessageLevel" character varying(64) NOT NULL,
"ActiveTime" timestamp without time zone NOT NULL,
"ExpireTime" timestamp without time zone NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Message_Announcement" PRIMARY KEY ("Id")
);
CREATE TABLE "Message_MessageType" (
"Id" uuid NOT NULL,
"MessageTypeCode" character varying(64) NULL,
"MessageTypeName" character varying(64) NULL,
"EmailTemplate" character varying(3072) NULL,
"SmsTemplate" character varying(1024) NULL,
"IsSendEmail" boolean NOT NULL,
"IsSendSms" boolean NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Message_MessageType" PRIMARY KEY ("Id")
);
CREATE TABLE "Message_MessageTypeSubscribe" (
"Id" uuid NOT NULL,
"UserId" uuid NOT NULL,
"Username" character varying(64) NULL,
"MessageTypeId" uuid NOT NULL,
"MessageTypeCode" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Message_MessageTypeSubscribe" PRIMARY KEY ("Id")
);
CREATE TABLE "Message_NotifyMessage" (
"Id" uuid NOT NULL,
"MessageType" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
"Title" character varying(64) NOT NULL,
"Content" text NULL,
"MessageLevel" character varying(64) NOT NULL,
"SendTime" timestamp without time zone NOT NULL,
CONSTRAINT "PK_Message_NotifyMessage" PRIMARY KEY ("Id")
);
CREATE TABLE "Message_PrivateMessage" (
"Id" uuid NOT NULL,
"FromUserId" uuid NOT NULL,
"ToUserId" uuid NOT NULL,
"FromUsername" character varying(64) NOT NULL,
"ToUsername" character varying(64) NOT NULL,
"HasRead" boolean NOT NULL,
"ReadTime" timestamp without time zone NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
"Title" character varying(64) NOT NULL,
"Content" text NULL,
"MessageLevel" character varying(64) NOT NULL,
"SendTime" timestamp without time zone NOT NULL,
CONSTRAINT "PK_Message_PrivateMessage" PRIMARY KEY ("Id")
);
CREATE TABLE "Message_UserNotifyMessage" (
"Id" uuid NOT NULL,
"UserId" uuid NOT NULL,
"Username" character varying(64) NULL,
"MessageId" uuid NOT NULL,
"Title" character varying(1024) NULL,
"HasRead" boolean NOT NULL,
"ReadTime" timestamp without time zone NULL,
"HasPush" boolean NOT NULL,
"PushTime" timestamp without time zone NULL,
"SmsHasSent" boolean NOT NULL,
"SmsSendTime" timestamp without time zone NULL,
"EmailHasSent" boolean NOT NULL,
"EmailSendTime" timestamp without time zone NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Message_UserNotifyMessage" PRIMARY KEY ("Id")
);
CREATE INDEX "IX_Message_Announcement_Title" ON "Message_Announcement" ("Title");
CREATE INDEX "IX_Message_MessageType_MessageTypeCode" ON "Message_MessageType" ("MessageTypeCode");
CREATE INDEX "IX_Message_MessageTypeSubscribe_UserId_MessageTypeId" ON "Message_MessageTypeSubscribe" ("UserId", "MessageTypeId");
CREATE INDEX "IX_Message_NotifyMessage_Title" ON "Message_NotifyMessage" ("Title");
CREATE INDEX "IX_Message_PrivateMessage_FromUserId_ToUserId_Title" ON "Message_PrivateMessage" ("FromUserId", "ToUserId", "Title");
CREATE INDEX "IX_Message_UserNotifyMessage_UserId_MessageId" ON "Message_UserNotifyMessage" ("UserId", "MessageId");

378
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.InventoryDbContext.sql

@ -0,0 +1,378 @@
CREATE TABLE "Inventory_Balance" (
"Id" uuid NOT NULL,
"PackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"Lot" character varying(64) NOT NULL,
"SerialNumber" character varying(64) NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"StdPackQty" numeric(18,6) NOT NULL,
"Status" character varying(64) NOT NULL,
"WarehouseCode" character varying(64) NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"LocationArea" character varying(64) NOT NULL,
"LocationGroup" character varying(64) NOT NULL,
"LocationErpCode" character varying(64) NOT NULL,
"PutInTime" timestamp without time zone NOT NULL,
"ContainerCode" character varying(64) NULL,
"LastCountTime" timestamp without time zone NOT NULL,
"LastCountPlanNumber" character varying(64) NULL,
"LastCountLabel" character varying(64) NULL,
"IsActive" boolean NOT NULL DEFAULT FALSE,
"ManageType" character varying(64) NOT NULL,
"LastTransType" character varying(64) NOT NULL,
"LastTransNumber" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_Balance" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_Container" (
"Id" uuid NOT NULL,
"ContainerCode" character varying(64) NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"Type" character varying(64) NULL,
"Capacity" numeric(18,6) NOT NULL,
"ProjectCode" text NULL,
"SeqNo" text NULL,
"BusinessStatus" character varying(64) NOT NULL,
"Status" character varying(64) NOT NULL,
"WarehouseCode" text NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
"Worker" text NULL,
"Number" text NULL,
CONSTRAINT "PK_Inventory_Container" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_ErpBalance" (
"Id" uuid NOT NULL,
"ItemCode" character varying(64) NOT NULL,
"Lot" character varying(64) NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"Status" text NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_ErpBalance" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_ExpectIn" (
"Id" uuid NOT NULL,
"PackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"Lot" character varying(64) NULL,
"SerialNumber" character varying(64) NULL,
"Status" character varying(64) NOT NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"JobNumber" character varying(64) NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"LocationArea" character varying(64) NOT NULL,
"LocationGroup" character varying(64) NOT NULL,
"LocationErpCode" character varying(64) NOT NULL,
"ContainerCode" character varying(64) NULL,
"WarehouseCode" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_ExpectIn" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_ExpectOut" (
"Id" uuid NOT NULL,
"PackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"Lot" character varying(64) NULL,
"SerialNumber" character varying(64) NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"Status" character varying(64) NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"LocationArea" character varying(64) NOT NULL,
"LocationGroup" character varying(64) NOT NULL,
"LocationErpCode" character varying(64) NOT NULL,
"JobNumber" character varying(64) NOT NULL,
"ContainerCode" character varying(64) NULL,
"WarehouseCode" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_ExpectOut" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_LocationCapacity" (
"Id" uuid NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"UsedCapacity" numeric(18,6) NOT NULL,
"AvailableCapacity" numeric(18,6) NOT NULL,
"BearableOverloadCapacity" numeric(18,6) NOT NULL,
"IsInfinity" boolean NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_LocationCapacity" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_Snapshot" (
"Id" uuid NOT NULL,
"SnapshotDate" timestamp without time zone NOT NULL,
"SnapshotTime" timestamp without time zone NOT NULL,
"PackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"Lot" character varying(64) NULL,
"SerialNumber" character varying(64) NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"Status" character varying(64) NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"LocationArea" character varying(64) NOT NULL,
"LocationGroup" character varying(64) NOT NULL,
"LocationErpCode" character varying(64) NOT NULL,
"PutInTime" timestamp without time zone NOT NULL,
"ContainerCode" character varying(64) NULL,
"WarehouseCode" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_Snapshot" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_Transaction" (
"Id" uuid NOT NULL,
"TransNumber" character varying(64) NOT NULL,
"TransType" character varying(64) NOT NULL,
"TransSubType" character varying(64) NOT NULL,
"TransInOut" character varying(64) NOT NULL,
"PackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"Lot" character varying(64) NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"StdPackQty" numeric(18,6) NOT NULL,
"Status" character varying(64) NOT NULL,
"WarehouseCode" character varying(64) NOT NULL,
"LocationCode" character varying(64) NOT NULL,
"LocationArea" character varying(64) NOT NULL,
"LocationGroup" character varying(64) NOT NULL,
"LocationErpCode" character varying(64) NOT NULL,
"ContainerCode" character varying(64) NULL,
"ActiveDate" timestamp without time zone NOT NULL,
"TransTime" timestamp without time zone NOT NULL,
"Worker" character varying(64) NULL,
"JobNumber" character varying(64) NULL,
"DocNumber" character varying(64) NULL,
"ManageType" character varying(64) NOT NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_Transaction" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_TransferLog" (
"Id" uuid NOT NULL,
"TransferNumber" character varying(64) NOT NULL,
"FromPackingCode" character varying(64) NOT NULL,
"ToPackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"StdPackQty" numeric(18,6) NOT NULL,
"FromTransNumber" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"FromLot" character varying(64) NULL,
"FromStatus" character varying(64) NOT NULL,
"FromWarehouseCode" character varying(64) NOT NULL,
"FromLocationCode" character varying(64) NOT NULL,
"FromLocationArea" character varying(64) NOT NULL,
"FromLocationGroup" character varying(64) NOT NULL,
"FromLocationErpCode" character varying(64) NOT NULL,
"FromContainerCode" character varying(64) NULL,
"ToTransNumber" character varying(64) NOT NULL,
"ToLot" character varying(64) NULL,
"ToStatus" character varying(64) NOT NULL,
"ToWarehouseCode" character varying(64) NOT NULL,
"ToLocationCode" character varying(64) NOT NULL,
"ToLocationArea" character varying(64) NOT NULL,
"ToLocationGroup" character varying(64) NOT NULL,
"ToLocationErpCode" character varying(64) NOT NULL,
"ToContainerCode" character varying(64) NULL,
"TransType" character varying(64) NOT NULL,
"TransSubType" character varying(64) NOT NULL,
"ActiveDate" timestamp without time zone NOT NULL,
"TransferTime" timestamp without time zone NOT NULL,
"Worker" character varying(64) NULL,
"JobNumber" character varying(64) NULL,
"DocNumber" character varying(64) NULL,
"ExtraProperties" text NULL,
"ConcurrencyStamp" character varying(40) NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"TenantId" uuid NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_TransferLog" PRIMARY KEY ("Id")
);
CREATE TABLE "Inventory_ContainerDetail" (
"Id" uuid NOT NULL,
"ContainerCode" character varying(64) NOT NULL,
"PackingCode" character varying(64) NOT NULL,
"ItemName" character varying(64) NULL,
"ItemDesc1" character varying(64) NULL,
"ItemDesc2" character varying(64) NULL,
"ItemCode" character varying(64) NOT NULL,
"SupplierBatch" character varying(64) NULL,
"ArriveDate" timestamp without time zone NOT NULL,
"ProduceDate" timestamp without time zone NOT NULL,
"ExpireDate" timestamp without time zone NOT NULL,
"Lot" character varying(64) NOT NULL,
"Uom" character varying(64) NOT NULL,
"Qty" numeric(18,6) NOT NULL,
"Status" character varying(64) NOT NULL,
"Year" text NULL,
"ProductNo" text NULL,
"ProjectCode" text NULL,
"Position" text NULL,
"SeqNo" text NULL,
"CreationTime" timestamp without time zone NOT NULL,
"CreatorId" uuid NULL,
"LastModificationTime" timestamp without time zone NULL,
"LastModifierId" uuid NULL,
"MasterID" uuid NOT NULL,
"TenantId" uuid NULL,
"Number" text NULL,
"Remark" character varying(3072) NULL,
CONSTRAINT "PK_Inventory_ContainerDetail" PRIMARY KEY ("Id"),
CONSTRAINT "FK_Inventory_ContainerDetail_Inventory_Container_MasterID" FOREIGN KEY ("MasterID") REFERENCES "Inventory_Container" ("Id") ON DELETE CASCADE
);
CREATE UNIQUE INDEX "IX_Inventory_Balance_PackingCode_Status_LocationCode_ItemCode_~" ON "Inventory_Balance" ("PackingCode", "Status", "LocationCode", "ItemCode", "Lot", "ContainerCode");
CREATE UNIQUE INDEX "IX_Inventory_Container_ContainerCode" ON "Inventory_Container" ("ContainerCode");
CREATE INDEX "IX_Inventory_ContainerDetail_MasterID" ON "Inventory_ContainerDetail" ("MasterID");
CREATE UNIQUE INDEX "IX_Inventory_ContainerDetail_PackingCode_Lot_ItemCode" ON "Inventory_ContainerDetail" ("PackingCode", "Lot", "ItemCode");
CREATE UNIQUE INDEX "IX_Inventory_ErpBalance_ItemCode_Lot_LocationCode_Status" ON "Inventory_ErpBalance" ("ItemCode", "Lot", "LocationCode", "Status");
CREATE UNIQUE INDEX "IX_Inventory_ExpectIn_PackingCode_LocationCode_ItemCode_JobNum~" ON "Inventory_ExpectIn" ("PackingCode", "LocationCode", "ItemCode", "JobNumber");
CREATE UNIQUE INDEX "IX_Inventory_ExpectOut_PackingCode_Status_ItemCode_LocationCod~" ON "Inventory_ExpectOut" ("PackingCode", "Status", "ItemCode", "LocationCode", "Lot", "JobNumber");
CREATE UNIQUE INDEX "IX_Inventory_LocationCapacity_LocationCode" ON "Inventory_LocationCapacity" ("LocationCode");
CREATE UNIQUE INDEX "IX_Inventory_Snapshot_SnapshotDate_SnapshotTime_PackingCode" ON "Inventory_Snapshot" ("SnapshotDate", "SnapshotTime", "PackingCode");
CREATE UNIQUE INDEX "IX_Inventory_Transaction_TransNumber" ON "Inventory_Transaction" ("TransNumber");
CREATE UNIQUE INDEX "IX_Inventory_TransferLog_TransferNumber" ON "Inventory_TransferLog" ("TransferNumber");

5691
be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Npgsql.EntityFrameworkCore.PostgreSQL.StoreDbContext.sql

File diff suppressed because it is too large

33
be/Modules/Shared/src/Win_in.Sfs.Shared.Host/IHostBuilderExtensions.cs → be/Modules/Shared/src/Win_in.Sfs.Shared.Host/HostBuilderExtensions.cs

@ -1,8 +1,10 @@
using System;
using System.Globalization;
using System.Net.Http;
using System.Reflection;
using AgileConfig.Client;
using Microsoft.AspNetCore.Builder;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
@ -11,7 +13,7 @@ using Volo.Abp.Modularity;
namespace Win_in.Sfs.Shared.Host;
public static class IHostBuilderExtensions
public static class HostBuilderExtensions
{
public static int BuildAndRun<TModule>(this WebApplicationBuilder builder) where TModule : IAbpModule
{
@ -24,29 +26,24 @@ public static class IHostBuilderExtensions
try
{
Log.Information($"Starting web host ${Assembly.GetEntryAssembly().GetName().Name}");
builder.Host
.UseAutofac()
.UseAgileConfig(o =>
builder.Host.ConfigureAppConfiguration((hc, cb) =>
{
var configClient = builder.Environment.EnvironmentName == "Development" ?
new ConfigClient($"appsettings.{builder.Environment.EnvironmentName}.json") :
new ConfigClient();
o.AppId = configClient.AppId;
o.Secret = configClient.Secret;
o.Nodes = configClient.ServerNodes;
o.ENV = configClient.Env;
var configUrl = cb.Build().GetValue("", "http://localhost:21093/settings/").TrimEnd('/');
AddJsonByUrl(cb, $"{configUrl}/appsettings.json");
if (builder.Environment.IsDevelopment())
{
AddJsonByUrl(cb, $"{configUrl}/appsettings.{builder.Environment.EnvironmentName}.json");
}
});
builder.Host.UseAutofac();
builder.AddApplicationAsync<TModule>().Wait();
builder.Host.UseSerilog((hostingContext, services, configBuilder) =>
{
if (Log.Logger.GetType() == typeof(ReloadableLogger))
{
configBuilder
.ReadFrom.Configuration(hostingContext.Configuration)
.ReadFrom.Services(services)
.Enrich.FromLogContext()
.WriteTo.Console(formatProvider: CultureInfo.InvariantCulture);
}
}, writeToProviders: false);
var app = builder.Build();
app.UseSerilogRequestLogging();
@ -64,4 +61,10 @@ public static class IHostBuilderExtensions
Log.CloseAndFlush();
}
}
private static void AddJsonByUrl(IConfigurationBuilder configurationBuilder, string url)
{
var stream = new HttpClient().GetStreamAsync(url).Result;
configurationBuilder.AddJsonStream(stream);
}
}

8
be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs

@ -46,13 +46,19 @@ namespace Win_in.Sfs.Shared.Host;
public abstract class ModuleBase<T> : AbpModule where T : AbpModule
{
static ModuleBase()
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var cfg = context.Services.GetConfiguration();
ServiceConfigurationContext.SetConsoleTitleOfWebApp(Assembly.GetEntryAssembly().GetName().Name);
LimitedResultRequestDto.MaxMaxResultCount = 100000;
context.Services.AddAgileConfig();
//context.Services.AddAgileConfig();
PreConfigureServices(context);
ConfigureAntiForgery();
ConfigureLocalizationServices();

22
be/WZC2.sln

@ -29,12 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Wms.DataExchange
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Wms.DataExchange.Iac.MesAgent", "DataExchange\src\Win_in.Sfs.Wms.DataExchange.MesAgent\Win_in.Sfs.Wms.DataExchange.Iac.MesAgent.csproj", "{6BA9342A-D26E-4C98-A02C-6780C0CC859A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gateways", "Gateways", "{E18F5C94-7D85-45E3-806B-A0975433788B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternalGateway.Host", "Gateways\InternalGateway\InternalGateway.Host\InternalGateway.Host.csproj", "{DDB8F68F-2D2B-46B6-A6BD-42488B3D4243}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAppGateway.Host", "Gateways\WebAppGateway\WebAppGateway.Host\WebAppGateway.Host.csproj", "{71862380-449F-48C7-850B-EADE103F14E3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosts", "Hosts", "{F17D371C-DF73-4CD7-8BE1-3254110FB20B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{A9DCA976-396C-487F-BCF1-70F5C5ACA2F9}"
@ -257,15 +251,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Wms.DataExchange
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Wms.Dashboard.Host", "Hosts\Win_in.Sfs.Wms.Dashboard.Host\Win_in.Sfs.Wms.Dashboard.Host.csproj", "{637A1F71-B29E-4247-B1C6-695790CE0525}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Config", "Config", "{AA2EB21B-5FE7-4C83-81FA-AC57CC9BE3F8}"
ProjectSection(SolutionItems) = preProject
Output\Config\CommonSettings.json = Output\Config\CommonSettings.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Shared.Host", "Modules\Shared\src\Win_in.Sfs.Shared.Host\Win_in.Sfs.Shared.Host.csproj", "{EBC2FEC4-BCCC-4430-953B-2712C0416BC6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1D67CBA8-80A6-4A91-B816-9D35B2DD94F8}"
ProjectSection(SolutionItems) = preProject
..\build\src\docker\publish\.env = ..\build\src\docker\publish\.env
..\build\src\docker\publish\settings\appsettings.Development.json = ..\build\src\docker\publish\settings\appsettings.Development.json
..\build\src\docker\publish\settings\appsettings.json = ..\build\src\docker\publish\settings\appsettings.json
EndProjectSection
@ -322,14 +312,6 @@ Global
{6BA9342A-D26E-4C98-A02C-6780C0CC859A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6BA9342A-D26E-4C98-A02C-6780C0CC859A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6BA9342A-D26E-4C98-A02C-6780C0CC859A}.Release|Any CPU.Build.0 = Release|Any CPU
{DDB8F68F-2D2B-46B6-A6BD-42488B3D4243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDB8F68F-2D2B-46B6-A6BD-42488B3D4243}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDB8F68F-2D2B-46B6-A6BD-42488B3D4243}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDB8F68F-2D2B-46B6-A6BD-42488B3D4243}.Release|Any CPU.Build.0 = Release|Any CPU
{71862380-449F-48C7-850B-EADE103F14E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71862380-449F-48C7-850B-EADE103F14E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71862380-449F-48C7-850B-EADE103F14E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71862380-449F-48C7-850B-EADE103F14E3}.Release|Any CPU.Build.0 = Release|Any CPU
{B06007E2-6B77-43E9-A20A-D0AB60E33BE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B06007E2-6B77-43E9-A20A-D0AB60E33BE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B06007E2-6B77-43E9-A20A-D0AB60E33BE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -684,8 +666,6 @@ Global
{C1C2B439-A555-4852-8E59-DBE0D7AD8F17} = {6EA46447-F3C7-4F33-B04E-2BA3567338DD}
{B21E726F-1B9E-48BD-B8D4-7B540105ED22} = {6EA46447-F3C7-4F33-B04E-2BA3567338DD}
{6BA9342A-D26E-4C98-A02C-6780C0CC859A} = {820295E6-920E-4DD0-85FC-6B3D83C2158D}
{DDB8F68F-2D2B-46B6-A6BD-42488B3D4243} = {E18F5C94-7D85-45E3-806B-A0975433788B}
{71862380-449F-48C7-850B-EADE103F14E3} = {E18F5C94-7D85-45E3-806B-A0975433788B}
{A9DCA976-396C-487F-BCF1-70F5C5ACA2F9} = {19170DC9-37E2-416A-AABC-F543C1B4A701}
{9802A799-8064-406D-8629-80C622A1BE46} = {A9DCA976-396C-487F-BCF1-70F5C5ACA2F9}
{B06007E2-6B77-43E9-A20A-D0AB60E33BE8} = {9802A799-8064-406D-8629-80C622A1BE46}

Loading…
Cancel
Save