Добавлен префикс таблицам первой структуры базы

This commit is contained in:
Mikhail Kuznetsov
2023-08-10 10:14:41 +10:00
parent f3538fdd5d
commit 39b1333969
38 changed files with 157 additions and 450 deletions

View File

@@ -1,24 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("Applications")]
public class Application : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public required string Name { get; set; }
public Guid ApplicationTypeId { get; set; }
[ForeignKey(nameof(ApplicationTypeId))]
public ApplicationType? ApplicationType { get; set; }
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
//public ICollection<Application> Applications { get;set; } = new HashSet<Application>();
}
}

View File

@@ -1,23 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("ApplicationsInHosts")]
public class ApplicationInHost : IBase
{
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public Guid ApplicationId { get; set; }
[ForeignKey(nameof(ApplicationId))]
public Application? Application { get; set; }
public Guid HostId { get; set; }
[ForeignKey(nameof(HostId))]
public Host? Host { get; set; }
}
}

View File

@@ -1,18 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("ApplicationTypes")]
public class ApplicationType : IBase
{
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public required string Name { get; set; }
public string? Description { get; set; }
public ICollection<ApplicationType> ApplicationTypes { get; set; } = new HashSet<ApplicationType>();
}
}

View File

@@ -1,27 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("Hosts")]
public class Host : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public string? HostName { get; set; }
public required string IP { get; set; }
public string? RegionalEK { get; set; }
public string? LinkEK { get; set; }
public string? Status { get; set; }
public string? WorkGroup { get; set; }
public string? Responsible { get; set; }
public ICollection<JobJournal> JobJournals { get; set; } = new HashSet<JobJournal>();
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
}
}

View File

@@ -1,50 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("Jobs")]
public class Job : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public required string Name { get; set; }
public required string ScriptName { get; set; }
public Guid JobModeId { get; set; }
[ForeignKey(nameof(JobModeId))]
public JobMode? JobMode { get; set; }
public Guid? JobCategoryId { get; set; }
[ForeignKey(nameof(JobCategoryId))]
public JobCategory? JobCategorye { get; set; }
public Guid? JobTypeId { get; set; }
[ForeignKey(nameof(JobTypeId))]
public JobType? JobType { get; set; }
public Guid ApplicationId { get; set; }
[ForeignKey(nameof(ApplicationId))]
public Application? Application { get; set; }
/// <summary>
/// Частота запуска Job в минутах
/// </summary>
public int Frequency { get; set; }
/// <summary>
/// В режиме manual значит время регистрации регламентной работы АСУ ЕСПП, в auto - время старта Job.
/// </summary>
public DateTimeOffset StartAt { get; set; }
/// <summary>
/// Активация Job
/// </summary>
public bool IsEnabled { get; set; }
public ICollection<JobJournal> Journals { get; set; } = new HashSet<JobJournal>();
}
}

View File

@@ -1,24 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("JobCategories")]
public class JobCategory : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
/// <summary>
/// app, db
/// </summary>
public required string Name { get; set; }
public string? Description { get; set; }
public ICollection<Job> Jobs { get; set; } = new HashSet<Job>();
}
}

View File

@@ -1,39 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("JobJournals")]
public class JobJournal : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
public DateTimeOffset DateOper { get; set; }
public string? Other { get; set; }
//Возможно нужно перенести в Job
public int? TimeOut { get; set; }
//Возможно нужно перенести в Job
public string? Info { get; set; }
public Guid JobStatusId { get; set; }
[ForeignKey(nameof(JobStatusId))]
public JobStatus? Status { get; set; }
public Guid HostId { get; set; }
[ForeignKey(nameof(HostId))]
public Host? Host { get; set; }
public Guid JobId { get; set; }
[ForeignKey(nameof(JobId))]
public Job? Job { get; set; }
}
}

View File

@@ -1,23 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("JobModes")]
public class JobMode : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
/// <summary>
/// manual, auto
/// </summary>
public required string Name { get; set; }
public ICollection<Job> Jobs { get; set; } = new HashSet<Job>();
}
}

View File

@@ -1,24 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("JobStatuses")]
public class JobStatus : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
/// <summary>
/// started, finished, timeout, error
/// </summary>
public required string Name { get; set; }
public string? Description { get; set; }
public ICollection<JobJournal> Journals { get; set; } = new HashSet<JobJournal>();
}
}

View File

@@ -1,23 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
[Table("JobTypes")]
public class JobType : IBase
{
[Key]
public Guid Id { get; set; }
public DateTimeOffset DateCreated { get; set; }
public DateTimeOffset? DateModified { get; set; }
/// <summary>
/// log-rotate, vacuum-psqld
/// </summary>
public required string Name { get; set; }
public string? Description { get; set; }
public ICollection<Job> Jobs { get; set; } = new HashSet<Job>();
}
}

View File

@@ -1,19 +0,0 @@
using PARR.DAL.Models.Base;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace PARR.DAL.Models
{
//[Table("Schedulers")]
//public class Scheduler : IBase
//{
// //[Key]
// //public Guid Id { get; set; }
// //public DateTimeOffset DateCreated { get; set; }
// //public DateTimeOffset? DateModified { get; set; }
// //public string? Name { get; set; }
// //public int Frequency { get; set; }
// //public required DateTimeOffset StartAt { get; set; }
// //public bool IsEnabled { get; set; }
//}
}