Add Migration for Discipline Service
This commit is contained in:
parent
ff711c38df
commit
5bb6cfbee8
26 changed files with 7386 additions and 170 deletions
|
|
@ -18,9 +18,10 @@ using Serilog.Exceptions;
|
|||
using Serilog.Sinks.Elasticsearch;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Transactions;
|
||||
using System.Data;
|
||||
using BMA.EHR.Discipline.Service.Filters;
|
||||
using BMA.EHR.Application.Repositories;
|
||||
using Hangfire.Oracle.Core;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
{
|
||||
|
|
@ -101,17 +102,18 @@ var builder = WebApplication.CreateBuilder(args);
|
|||
// Register DbContext
|
||||
var defaultConnection = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
builder.Services.AddDbContext<DisciplineDbContext>(options =>
|
||||
options.UseMySql(defaultConnection, ServerVersion.AutoDetect(defaultConnection)));
|
||||
options.UseOracle(defaultConnection, o => o.MigrationsHistoryTable("__DisciplineMigrationsHistory")));
|
||||
builder.Services.AddHealthChecks();
|
||||
|
||||
// Add Hangfire services.
|
||||
builder.Services.AddHangfire(configuration => configuration
|
||||
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
|
||||
.UseSimpleAssemblyNameTypeSerializer()
|
||||
.UseRecommendedSerializerSettings()
|
||||
.UseStorage(
|
||||
new MySqlStorage(
|
||||
new OracleStorage(
|
||||
defaultConnection,
|
||||
new MySqlStorageOptions
|
||||
new OracleStorageOptions
|
||||
{
|
||||
TransactionIsolationLevel = IsolationLevel.ReadCommitted,
|
||||
QueuePollInterval = TimeSpan.FromSeconds(15),
|
||||
|
|
@ -121,7 +123,7 @@ var builder = WebApplication.CreateBuilder(args);
|
|||
DashboardJobListLimit = 50000,
|
||||
TransactionTimeout = TimeSpan.FromMinutes(1),
|
||||
InvisibilityTimeout = TimeSpan.FromHours(3),
|
||||
TablesPrefix = "Hangfire"
|
||||
SchemaName = "HANGFIRE"
|
||||
})));
|
||||
builder.Services.AddHangfireServer();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue