API. Расписание для хоста в общем формате
This commit is contained in:
@@ -7,14 +7,10 @@ using PARR.API.Contracts.V1.Responses;
|
|||||||
using PARR.API.Contracts.V1.Responses.Base;
|
using PARR.API.Contracts.V1.Responses.Base;
|
||||||
using PARR.API.Controllers.V1.Base;
|
using PARR.API.Controllers.V1.Base;
|
||||||
using PARR.API.Extensions;
|
using PARR.API.Extensions;
|
||||||
using PARR.API.MappingProfiles;
|
|
||||||
using PARR.API.Services.Interfaces;
|
using PARR.API.Services.Interfaces;
|
||||||
using PARR.DAL.Contracts;
|
|
||||||
using PARR.DAL.DomainModels;
|
using PARR.DAL.DomainModels;
|
||||||
using PARR.DAL.Models;
|
using PARR.DAL.Models;
|
||||||
using PARR.DAL.Services.Interfaces;
|
using PARR.DAL.Services.Interfaces;
|
||||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
|
||||||
using static PARR.API.Contracts.V1.ApiRoutes;
|
|
||||||
|
|
||||||
namespace PARR.API.Controllers.V1
|
namespace PARR.API.Controllers.V1
|
||||||
{
|
{
|
||||||
@@ -223,7 +219,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
{
|
{
|
||||||
// отнимаем пока не наступили прошлые стуки
|
// отнимаем пока не наступили прошлые стуки
|
||||||
var min = startAtMinutes;
|
var min = startAtMinutes;
|
||||||
while (min > 0)
|
while (min >= 0)
|
||||||
{
|
{
|
||||||
//var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) };
|
//var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) };
|
||||||
//todo: check
|
//todo: check
|
||||||
@@ -234,7 +230,8 @@ namespace PARR.API.Controllers.V1
|
|||||||
}
|
}
|
||||||
|
|
||||||
// прибавляем пока не наступят след сутки
|
// прибавляем пока не наступят след сутки
|
||||||
while (min <= allDayMinutes)
|
min = startAtMinutes + job.Frequency;
|
||||||
|
while (min < allDayMinutes)
|
||||||
{
|
{
|
||||||
//TODO: check
|
//TODO: check
|
||||||
//var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) };
|
//var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) };
|
||||||
@@ -249,7 +246,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
// = queryDate
|
// = queryDate
|
||||||
// прибавляем пока не наступят след сутки
|
// прибавляем пока не наступят след сутки
|
||||||
var min = startAtMinutes;
|
var min = startAtMinutes;
|
||||||
while (min <= allDayMinutes)
|
while (min < allDayMinutes)
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
//var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) };
|
//var jobToAdded = new Job { StartAt = queryDate.StartOfDay().AddMinutes(min) };
|
||||||
|
|||||||
@@ -1,512 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
using PARR.DAL.Context;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace PARR.DAL.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(DataContext))]
|
|
||||||
[Migration("20230619021829_SchedulerClmnsToJob")]
|
|
||||||
partial class SchedulerClmnsToJob
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("ProductVersion", "7.0.5")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid?>("ApplicationId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("ApplicationTypeId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationTypeId");
|
|
||||||
|
|
||||||
b.ToTable("Applications");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("ApplicationId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<Guid>("HostId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
|
||||||
|
|
||||||
b.HasIndex("HostId");
|
|
||||||
|
|
||||||
b.ToTable("ApplicationsInHosts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("ApplicationTypes");
|
|
||||||
|
|
||||||
b.HasData(
|
|
||||||
new
|
|
||||||
{
|
|
||||||
Id = new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"),
|
|
||||||
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
Description = "Поле СП xml АИХ ИТ",
|
|
||||||
Name = "APP"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
Id = new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"),
|
|
||||||
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
Description = "Поле ОС xml АИХ ИТ",
|
|
||||||
Name = "OS"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
Id = new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"),
|
|
||||||
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
Description = "Поле СУБД xml АИХ ИТ",
|
|
||||||
Name = "DB"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("HostName")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("IP")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("LinkEK")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("RegionalEK")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Responsible")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Status")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("WorkGroup")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Hosts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("ApplicationId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Frequency")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEnabled")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<Guid?>("JobCategoryId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("JobModeId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("JobTypeId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ScriptName")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("StartAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
|
||||||
|
|
||||||
b.HasIndex("JobCategoryId");
|
|
||||||
|
|
||||||
b.HasIndex("JobModeId");
|
|
||||||
|
|
||||||
b.HasIndex("JobTypeId");
|
|
||||||
|
|
||||||
b.ToTable("Jobs");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobCategory", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("JobCategories");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobJournal", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("DateOper")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("HostId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Info")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<Guid>("JobId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("JobStatusId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("Other")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int?>("TimeOut")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("HostId");
|
|
||||||
|
|
||||||
b.HasIndex("JobId");
|
|
||||||
|
|
||||||
b.HasIndex("JobStatusId");
|
|
||||||
|
|
||||||
b.ToTable("JobJournals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("JobModes");
|
|
||||||
|
|
||||||
b.HasData(
|
|
||||||
new
|
|
||||||
{
|
|
||||||
Id = new Guid("fba4202c-5bad-49c4-b076-d1ca6e1fb158"),
|
|
||||||
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
Name = "auto"
|
|
||||||
},
|
|
||||||
new
|
|
||||||
{
|
|
||||||
Id = new Guid("7516b952-510d-4aaa-971c-a14b184fc1d5"),
|
|
||||||
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
|
||||||
Name = "manual"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("JobStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobType", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("JobTypes");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("PARR.DAL.Models.Application", null)
|
|
||||||
.WithMany("Applications")
|
|
||||||
.HasForeignKey("ApplicationId");
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ApplicationTypeId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("ApplicationType");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.ApplicationInHost", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("PARR.DAL.Models.Application", "Application")
|
|
||||||
.WithMany("ApplicationsInHosts")
|
|
||||||
.HasForeignKey("ApplicationId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.Host", "Host")
|
|
||||||
.WithMany("ApplicationsInHosts")
|
|
||||||
.HasForeignKey("HostId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Application");
|
|
||||||
|
|
||||||
b.Navigation("Host");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("PARR.DAL.Models.Application", "Application")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ApplicationId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.JobCategory", "JobCategorye")
|
|
||||||
.WithMany("Jobs")
|
|
||||||
.HasForeignKey("JobCategoryId");
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.JobMode", "JobMode")
|
|
||||||
.WithMany("Jobs")
|
|
||||||
.HasForeignKey("JobModeId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.JobType", "JobType")
|
|
||||||
.WithMany("Jobs")
|
|
||||||
.HasForeignKey("JobTypeId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Application");
|
|
||||||
|
|
||||||
b.Navigation("JobCategorye");
|
|
||||||
|
|
||||||
b.Navigation("JobMode");
|
|
||||||
|
|
||||||
b.Navigation("JobType");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobJournal", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("PARR.DAL.Models.Host", "Host")
|
|
||||||
.WithMany("JobJournals")
|
|
||||||
.HasForeignKey("HostId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.Job", "Job")
|
|
||||||
.WithMany("Journals")
|
|
||||||
.HasForeignKey("JobId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.JobStatus", "Status")
|
|
||||||
.WithMany("Journals")
|
|
||||||
.HasForeignKey("JobStatusId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Host");
|
|
||||||
|
|
||||||
b.Navigation("Job");
|
|
||||||
|
|
||||||
b.Navigation("Status");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Applications");
|
|
||||||
|
|
||||||
b.Navigation("ApplicationsInHosts");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("ApplicationsInHosts");
|
|
||||||
|
|
||||||
b.Navigation("JobJournals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Journals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobCategory", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Jobs");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobMode", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Jobs");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobStatus", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Journals");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobType", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Jobs");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace PARR.DAL.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class SchedulerClmnsToJob : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Schedulers");
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "Frequency",
|
|
||||||
table: "Jobs",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "IsEnabled",
|
|
||||||
table: "Jobs",
|
|
||||||
type: "boolean",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<DateTimeOffset>(
|
|
||||||
name: "StartAt",
|
|
||||||
table: "Jobs",
|
|
||||||
type: "timestamp with time zone",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Frequency",
|
|
||||||
table: "Jobs");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "IsEnabled",
|
|
||||||
table: "Jobs");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "StartAt",
|
|
||||||
table: "Jobs");
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Schedulers",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
||||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
|
||||||
Frequency = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: true),
|
|
||||||
StartAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Schedulers", x => x.Id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
||||||
|
|
||||||
namespace PARR.DAL.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class TblStatus : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.InsertData(
|
|
||||||
table: "JobStatuses",
|
|
||||||
columns: new[] { "Id", "DateCreated", "DateModified", "Description", "Name" },
|
|
||||||
values: new object[,]
|
|
||||||
{
|
|
||||||
{ new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Задание выполнено", "finished" },
|
|
||||||
{ new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Задание запущено", "started" }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DeleteData(
|
|
||||||
table: "JobStatuses",
|
|
||||||
keyColumn: "Id",
|
|
||||||
keyValue: new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"));
|
|
||||||
|
|
||||||
migrationBuilder.DeleteData(
|
|
||||||
table: "JobStatuses",
|
|
||||||
keyColumn: "Id",
|
|
||||||
keyValue: new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -12,8 +12,8 @@ using PARR.DAL.Context;
|
|||||||
namespace PARR.DAL.Migrations
|
namespace PARR.DAL.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DataContext))]
|
[DbContext(typeof(DataContext))]
|
||||||
[Migration("20230620022903_TblStatus")]
|
[Migration("20230621014955_DbV5")]
|
||||||
partial class TblStatus
|
partial class DbV5
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -31,9 +31,6 @@ namespace PARR.DAL.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid?>("ApplicationId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("ApplicationTypeId")
|
b.Property<Guid>("ApplicationTypeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
@@ -49,8 +46,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationTypeId");
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
b.ToTable("Applications");
|
b.ToTable("Applications");
|
||||||
@@ -89,6 +84,9 @@ namespace PARR.DAL.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
@@ -104,6 +102,8 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
b.ToTable("ApplicationTypes");
|
b.ToTable("ApplicationTypes");
|
||||||
|
|
||||||
b.HasData(
|
b.HasData(
|
||||||
@@ -259,8 +259,8 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<DateTimeOffset?>("DateModified")
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<string>("DateOper")
|
b.Property<DateTimeOffset>("DateOper")
|
||||||
.HasColumnType("text");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<Guid>("HostId")
|
b.Property<Guid>("HostId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
@@ -392,10 +392,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Application", null)
|
|
||||||
.WithMany("Applications")
|
|
||||||
.HasForeignKey("ApplicationId");
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("ApplicationTypeId")
|
.HasForeignKey("ApplicationTypeId")
|
||||||
@@ -424,6 +420,13 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Navigation("Host");
|
b.Navigation("Host");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.ApplicationType", null)
|
||||||
|
.WithMany("ApplicationTypes")
|
||||||
|
.HasForeignKey("ApplicationTypeId");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Application", "Application")
|
b.HasOne("PARR.DAL.Models.Application", "Application")
|
||||||
@@ -486,11 +489,14 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Applications");
|
|
||||||
|
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationTypes");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
@@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
|||||||
namespace PARR.DAL.Migrations
|
namespace PARR.DAL.Migrations
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public partial class DbV2 : Migration
|
public partial class DbV5 : Migration
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
@@ -21,11 +21,17 @@ namespace PARR.DAL.Migrations
|
|||||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
Name = table.Column<string>(type: "text", nullable: false),
|
||||||
Description = table.Column<string>(type: "text", nullable: true)
|
Description = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ApplicationTypeId = table.Column<Guid>(type: "uuid", nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_ApplicationTypes", x => x.Id);
|
table.PrimaryKey("PK_ApplicationTypes", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ApplicationTypes_ApplicationTypes_ApplicationTypeId",
|
||||||
|
column: x => x.ApplicationTypeId,
|
||||||
|
principalTable: "ApplicationTypes",
|
||||||
|
principalColumn: "Id");
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
@@ -107,23 +113,6 @@ namespace PARR.DAL.Migrations
|
|||||||
table.PrimaryKey("PK_JobTypes", x => x.Id);
|
table.PrimaryKey("PK_JobTypes", x => x.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Schedulers",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
||||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
||||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: true),
|
|
||||||
Frequency = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
StartAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
||||||
IsEnabled = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Schedulers", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Applications",
|
name: "Applications",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@@ -132,8 +121,7 @@ namespace PARR.DAL.Migrations
|
|||||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
Name = table.Column<string>(type: "text", nullable: false),
|
||||||
ApplicationTypeId = table.Column<Guid>(type: "uuid", nullable: false),
|
ApplicationTypeId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
ApplicationId = table.Column<Guid>(type: "uuid", nullable: true)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -144,11 +132,6 @@ namespace PARR.DAL.Migrations
|
|||||||
principalTable: "ApplicationTypes",
|
principalTable: "ApplicationTypes",
|
||||||
principalColumn: "Id",
|
principalColumn: "Id",
|
||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Applications_Applications_ApplicationId",
|
|
||||||
column: x => x.ApplicationId,
|
|
||||||
principalTable: "Applications",
|
|
||||||
principalColumn: "Id");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
@@ -190,7 +173,10 @@ namespace PARR.DAL.Migrations
|
|||||||
JobModeId = table.Column<Guid>(type: "uuid", nullable: false),
|
JobModeId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
JobCategoryId = table.Column<Guid>(type: "uuid", nullable: true),
|
JobCategoryId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
JobTypeId = table.Column<Guid>(type: "uuid", nullable: false),
|
JobTypeId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
ApplicationId = table.Column<Guid>(type: "uuid", nullable: false)
|
ApplicationId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Frequency = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
StartAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||||
|
IsEnabled = table.Column<bool>(type: "boolean", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -227,7 +213,7 @@ namespace PARR.DAL.Migrations
|
|||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
DateCreated = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||||
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
DateModified = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||||
DateOper = table.Column<string>(type: "text", nullable: true),
|
DateOper = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||||
Other = table.Column<string>(type: "text", nullable: true),
|
Other = table.Column<string>(type: "text", nullable: true),
|
||||||
TimeOut = table.Column<int>(type: "integer", nullable: true),
|
TimeOut = table.Column<int>(type: "integer", nullable: true),
|
||||||
Info = table.Column<string>(type: "text", nullable: true),
|
Info = table.Column<string>(type: "text", nullable: true),
|
||||||
@@ -260,12 +246,12 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
migrationBuilder.InsertData(
|
migrationBuilder.InsertData(
|
||||||
table: "ApplicationTypes",
|
table: "ApplicationTypes",
|
||||||
columns: new[] { "Id", "DateCreated", "DateModified", "Description", "Name" },
|
columns: new[] { "Id", "ApplicationTypeId", "DateCreated", "DateModified", "Description", "Name" },
|
||||||
values: new object[,]
|
values: new object[,]
|
||||||
{
|
{
|
||||||
{ new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Поле СП xml АИХ ИТ", "APP" },
|
{ new Guid("32c28386-6f13-4f7b-8508-be165b7fabdb"), null, new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Поле СП xml АИХ ИТ", "APP" },
|
||||||
{ new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Поле ОС xml АИХ ИТ", "OS" },
|
{ new Guid("7848a96c-cdee-48c1-a786-de9cb889723a"), null, new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Поле ОС xml АИХ ИТ", "OS" },
|
||||||
{ new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Поле СУБД xml АИХ ИТ", "DB" }
|
{ new Guid("aae2636f-b93a-42dc-873e-0764a90a0a40"), null, new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Поле СУБД xml АИХ ИТ", "DB" }
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.InsertData(
|
migrationBuilder.InsertData(
|
||||||
@@ -277,10 +263,14 @@ namespace PARR.DAL.Migrations
|
|||||||
{ new Guid("fba4202c-5bad-49c4-b076-d1ca6e1fb158"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "auto" }
|
{ new Guid("fba4202c-5bad-49c4-b076-d1ca6e1fb158"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "auto" }
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.InsertData(
|
||||||
name: "IX_Applications_ApplicationId",
|
table: "JobStatuses",
|
||||||
table: "Applications",
|
columns: new[] { "Id", "DateCreated", "DateModified", "Description", "Name" },
|
||||||
column: "ApplicationId");
|
values: new object[,]
|
||||||
|
{
|
||||||
|
{ new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Задание выполнено", "finished" },
|
||||||
|
{ new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"), new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), null, "Задание запущено", "started" }
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Applications_ApplicationTypeId",
|
name: "IX_Applications_ApplicationTypeId",
|
||||||
@@ -297,6 +287,11 @@ namespace PARR.DAL.Migrations
|
|||||||
table: "ApplicationsInHosts",
|
table: "ApplicationsInHosts",
|
||||||
column: "HostId");
|
column: "HostId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ApplicationTypes_ApplicationTypeId",
|
||||||
|
table: "ApplicationTypes",
|
||||||
|
column: "ApplicationTypeId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_JobJournals_HostId",
|
name: "IX_JobJournals_HostId",
|
||||||
table: "JobJournals",
|
table: "JobJournals",
|
||||||
@@ -342,9 +337,6 @@ namespace PARR.DAL.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "JobJournals");
|
name: "JobJournals");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Schedulers");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Hosts");
|
name: "Hosts");
|
||||||
|
|
||||||
@@ -12,8 +12,8 @@ using PARR.DAL.Context;
|
|||||||
namespace PARR.DAL.Migrations
|
namespace PARR.DAL.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(DataContext))]
|
[DbContext(typeof(DataContext))]
|
||||||
[Migration("20230616045916_DbV2")]
|
[Migration("20230621015625_DbV5.1")]
|
||||||
partial class DbV2
|
partial class DbV51
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
@@ -31,9 +31,6 @@ namespace PARR.DAL.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid?>("ApplicationId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("ApplicationTypeId")
|
b.Property<Guid>("ApplicationTypeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
@@ -49,8 +46,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationTypeId");
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
b.ToTable("Applications");
|
b.ToTable("Applications");
|
||||||
@@ -89,6 +84,9 @@ namespace PARR.DAL.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
@@ -104,6 +102,8 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
b.ToTable("ApplicationTypes");
|
b.ToTable("ApplicationTypes");
|
||||||
|
|
||||||
b.HasData(
|
b.HasData(
|
||||||
@@ -184,13 +184,19 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<DateTimeOffset?>("DateModified")
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<int>("Frequency")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<bool>("IsEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
b.Property<Guid?>("JobCategoryId")
|
b.Property<Guid?>("JobCategoryId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid>("JobModeId")
|
b.Property<Guid>("JobModeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid>("JobTypeId")
|
b.Property<Guid?>("JobTypeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
@@ -201,6 +207,9 @@ namespace PARR.DAL.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset>("StartAt")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
b.HasIndex("ApplicationId");
|
||||||
@@ -250,8 +259,8 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<DateTimeOffset?>("DateModified")
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<string>("DateOper")
|
b.Property<DateTimeOffset>("DateOper")
|
||||||
.HasColumnType("text");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<Guid>("HostId")
|
b.Property<Guid>("HostId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
@@ -339,6 +348,22 @@ namespace PARR.DAL.Migrations
|
|||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("JobStatuses");
|
b.ToTable("JobStatuses");
|
||||||
|
|
||||||
|
b.HasData(
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("edef6dc3-adad-4c77-8ad1-63bb9052355a"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Задание запущено",
|
||||||
|
Name = "started"
|
||||||
|
},
|
||||||
|
new
|
||||||
|
{
|
||||||
|
Id = new Guid("7b945eb6-d885-4570-aff5-8866f1f75ff2"),
|
||||||
|
DateCreated = new DateTimeOffset(new DateTime(2023, 5, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
|
||||||
|
Description = "Задание выполнено",
|
||||||
|
Name = "finished"
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.JobType", b =>
|
modelBuilder.Entity("PARR.DAL.Models.JobType", b =>
|
||||||
@@ -365,41 +390,8 @@ namespace PARR.DAL.Migrations
|
|||||||
b.ToTable("JobTypes");
|
b.ToTable("JobTypes");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Scheduler", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset?>("DateModified")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("Frequency")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("IsEnabled")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("StartAt")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Schedulers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Application", null)
|
|
||||||
.WithMany("Applications")
|
|
||||||
.HasForeignKey("ApplicationId");
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("ApplicationTypeId")
|
.HasForeignKey("ApplicationTypeId")
|
||||||
@@ -428,6 +420,13 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Navigation("Host");
|
b.Navigation("Host");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.ApplicationType", null)
|
||||||
|
.WithMany("ApplicationTypes")
|
||||||
|
.HasForeignKey("ApplicationTypeId");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Application", "Application")
|
b.HasOne("PARR.DAL.Models.Application", "Application")
|
||||||
@@ -448,9 +447,7 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.JobType", "JobType")
|
b.HasOne("PARR.DAL.Models.JobType", "JobType")
|
||||||
.WithMany("Jobs")
|
.WithMany("Jobs")
|
||||||
.HasForeignKey("JobTypeId")
|
.HasForeignKey("JobTypeId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Application");
|
b.Navigation("Application");
|
||||||
|
|
||||||
@@ -490,11 +487,14 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Applications");
|
|
||||||
|
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationTypes");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
60
PARR.DAL/Migrations/20230621015625_DbV5.1.cs
Normal file
60
PARR.DAL/Migrations/20230621015625_DbV5.1.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class DbV51 : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Jobs_JobTypes_JobTypeId",
|
||||||
|
table: "Jobs");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "JobTypeId",
|
||||||
|
table: "Jobs",
|
||||||
|
type: "uuid",
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "uuid");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Jobs_JobTypes_JobTypeId",
|
||||||
|
table: "Jobs",
|
||||||
|
column: "JobTypeId",
|
||||||
|
principalTable: "JobTypes",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Jobs_JobTypes_JobTypeId",
|
||||||
|
table: "Jobs");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<Guid>(
|
||||||
|
name: "JobTypeId",
|
||||||
|
table: "Jobs",
|
||||||
|
type: "uuid",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||||
|
oldClrType: typeof(Guid),
|
||||||
|
oldType: "uuid",
|
||||||
|
oldNullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Jobs_JobTypes_JobTypeId",
|
||||||
|
table: "Jobs",
|
||||||
|
column: "JobTypeId",
|
||||||
|
principalTable: "JobTypes",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,9 +28,6 @@ namespace PARR.DAL.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid?>("ApplicationId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<Guid>("ApplicationTypeId")
|
b.Property<Guid>("ApplicationTypeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
@@ -46,8 +43,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ApplicationId");
|
|
||||||
|
|
||||||
b.HasIndex("ApplicationTypeId");
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
b.ToTable("Applications");
|
b.ToTable("Applications");
|
||||||
@@ -86,6 +81,9 @@ namespace PARR.DAL.Migrations
|
|||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ApplicationTypeId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("DateCreated")
|
b.Property<DateTimeOffset>("DateCreated")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
@@ -101,6 +99,8 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationTypeId");
|
||||||
|
|
||||||
b.ToTable("ApplicationTypes");
|
b.ToTable("ApplicationTypes");
|
||||||
|
|
||||||
b.HasData(
|
b.HasData(
|
||||||
@@ -193,7 +193,7 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<Guid>("JobModeId")
|
b.Property<Guid>("JobModeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<Guid>("JobTypeId")
|
b.Property<Guid?>("JobTypeId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
@@ -256,8 +256,8 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Property<DateTimeOffset?>("DateModified")
|
b.Property<DateTimeOffset?>("DateModified")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<string>("DateOper")
|
b.Property<DateTimeOffset>("DateOper")
|
||||||
.HasColumnType("text");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<Guid>("HostId")
|
b.Property<Guid>("HostId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
@@ -389,10 +389,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Application", null)
|
|
||||||
.WithMany("Applications")
|
|
||||||
.HasForeignKey("ApplicationId");
|
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
b.HasOne("PARR.DAL.Models.ApplicationType", "ApplicationType")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("ApplicationTypeId")
|
.HasForeignKey("ApplicationTypeId")
|
||||||
@@ -421,6 +417,13 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Navigation("Host");
|
b.Navigation("Host");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("PARR.DAL.Models.ApplicationType", null)
|
||||||
|
.WithMany("ApplicationTypes")
|
||||||
|
.HasForeignKey("ApplicationTypeId");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Job", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Application", "Application")
|
b.HasOne("PARR.DAL.Models.Application", "Application")
|
||||||
@@ -441,9 +444,7 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.JobType", "JobType")
|
b.HasOne("PARR.DAL.Models.JobType", "JobType")
|
||||||
.WithMany("Jobs")
|
.WithMany("Jobs")
|
||||||
.HasForeignKey("JobTypeId")
|
.HasForeignKey("JobTypeId");
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Application");
|
b.Navigation("Application");
|
||||||
|
|
||||||
@@ -483,11 +484,14 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Application", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("Applications");
|
|
||||||
|
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("PARR.DAL.Models.ApplicationType", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("ApplicationTypes");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ namespace PARR.DAL.Models
|
|||||||
|
|
||||||
|
|
||||||
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
|
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
|
||||||
public ICollection<Application> Applications { get;set; } = new HashSet<Application>();
|
//public ICollection<Application> Applications { get;set; } = new HashSet<Application>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,5 +11,8 @@ namespace PARR.DAL.Models
|
|||||||
public DateTimeOffset? DateModified { get; set; }
|
public DateTimeOffset? DateModified { get; set; }
|
||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public ICollection<ApplicationType> ApplicationTypes { get; set; } = new HashSet<ApplicationType>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace PARR.DAL.Models
|
|||||||
[ForeignKey(nameof(JobCategoryId))]
|
[ForeignKey(nameof(JobCategoryId))]
|
||||||
public JobCategory? JobCategorye { get; set; }
|
public JobCategory? JobCategorye { get; set; }
|
||||||
|
|
||||||
public Guid JobTypeId { get; set; }
|
public Guid? JobTypeId { get; set; }
|
||||||
[ForeignKey(nameof(JobTypeId))]
|
[ForeignKey(nameof(JobTypeId))]
|
||||||
public JobType? JobType { get; set; }
|
public JobType? JobType { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -24,17 +24,17 @@ namespace PARR.DAL.Services.Implementations
|
|||||||
|
|
||||||
public async Task<JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date)
|
public async Task<JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date)
|
||||||
{
|
{
|
||||||
var n=DateTimeOffset.UtcNow;
|
//var n=DateTimeOffset.UtcNow;
|
||||||
var opers = await EntitySet
|
|
||||||
.Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper.AddTicks(0-j.DateOper.UtcTicks) <= n))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay()))
|
|
||||||
.OrderBy(t => t.DateOper)
|
|
||||||
.LastOrDefaultAsync();
|
|
||||||
|
|
||||||
//var opers = await EntitySet
|
//var opers = await EntitySet
|
||||||
// .Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date)
|
// .Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper!=DateTimeOffset.MinValue))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay()))
|
||||||
// .OrderBy(t => t.DateOper)
|
// .OrderBy(t => t.DateOper)
|
||||||
// .LastOrDefaultAsync();
|
// .LastOrDefaultAsync();
|
||||||
|
|
||||||
|
var opers = await EntitySet
|
||||||
|
.Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date)
|
||||||
|
.OrderBy(t => t.DateOper)
|
||||||
|
.LastOrDefaultAsync();
|
||||||
|
|
||||||
return opers;
|
return opers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user