init_db
This commit is contained in:
22
PARR.DAL/Models/Host.cs
Normal file
22
PARR.DAL/Models/Host.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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 required string HostName { get; set; }
|
||||
public required string IP { get; set; }
|
||||
public string? EK { get; set; }
|
||||
|
||||
|
||||
|
||||
public ICollection<JobJournal> JobJournals { get; set; } = new HashSet<JobJournal>();
|
||||
}
|
||||
}
|
||||
32
PARR.DAL/Models/Job.cs
Normal file
32
PARR.DAL/Models/Job.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
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 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 ICollection<JobJournal> Journals { get; set; } = new HashSet<JobJournal>();
|
||||
}
|
||||
}
|
||||
24
PARR.DAL/Models/JobCategory.cs
Normal file
24
PARR.DAL/Models/JobCategory.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
39
PARR.DAL/Models/JobJournal.cs
Normal file
39
PARR.DAL/Models/JobJournal.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
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 string? 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; }
|
||||
}
|
||||
}
|
||||
23
PARR.DAL/Models/JobMode.cs
Normal file
23
PARR.DAL/Models/JobMode.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
24
PARR.DAL/Models/JobStatus.cs
Normal file
24
PARR.DAL/Models/JobStatus.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
23
PARR.DAL/Models/JobType.cs
Normal file
23
PARR.DAL/Models/JobType.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user