pavelbannov
18a2c0a53d
# Conflicts: # common/ASC.Core.Common/EF/Model/Audit/LoginEvents.cs # common/ASC.Core.Common/EF/Model/CRM/CrmContact.cs # common/ASC.Core.Common/EF/Model/CRM/DbVoipCall.cs # common/ASC.Core.Common/EF/Model/CRM/VoipNumber.cs # common/ASC.Core.Common/EF/Model/DbWebstudioIndex.cs # common/ASC.Core.Common/EF/Model/DbipLocation.cs # common/ASC.Core.Common/EF/Model/Feed/FeedAggregate.cs # common/ASC.Core.Common/EF/Model/Feed/FeedLast.cs # common/ASC.Core.Common/EF/Model/Mail/Mailbox.cs # common/ASC.Core.Common/EF/Model/Mail/ServerServer.cs # common/ASC.Core.Common/EF/Model/Notify/NotifyInfo.cs # common/ASC.Core.Common/EF/Model/Notify/NotifyQueue.cs # common/ASC.Core.Common/EF/Model/Resource/ResAuthors.cs # common/ASC.Core.Common/EF/Model/Resource/ResCultures.cs # common/ASC.Core.Common/EF/Model/Resource/ResData.cs # common/ASC.Core.Common/EF/Model/Resource/ResFiles.cs # common/ASC.Core.Common/EF/Model/Resource/ResReserve.cs # common/ASC.Core.Common/EF/Model/Tenant/DbTariff.cs # common/ASC.Core.Common/EF/Model/Tenant/DbTenantVersion.cs # common/ASC.Core.Common/EF/Model/Tenant/TenantIpRestrictions.cs # common/ASC.Core.Common/EF/Model/User/UserPhoto.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/20201006100008_CoreDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/20210309093641_CoreDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/CoreDbContextMySql/MySqlCoreDbContextModelSnapshot.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20201006101436_TenantDbContextMySql.Designer.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20201006101436_TenantDbContextMySql.cs # common/ASC.Core.Common/Migrations/MySql/TenantDbContextMySql/20210309095116_TenantDbContextMySql.Designer.cs # products/ASC.Files/Core/Core/EF/DbFilesTag.cs # products/ASC.Files/Core/Core/EF/FilesDbContext.cs
76 lines
2.5 KiB
C#
76 lines
2.5 KiB
C#
using System;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace ASC.Core.Common.EF.Model
|
|
{
|
|
public class NotifyInfo
|
|
{
|
|
public int NotifyId { get; set; }
|
|
public int State { get; set; }
|
|
public int Attempts { get; set; }
|
|
public DateTime ModifyDate { get; set; }
|
|
public int Priority { get; set; }
|
|
}
|
|
public static class NotifyInfoExtension
|
|
{
|
|
public static ModelBuilderWrapper AddNotifyInfo(this ModelBuilderWrapper modelBuilder)
|
|
{
|
|
modelBuilder
|
|
.Add(MySqlAddNotifyInfo, Provider.MySql)
|
|
.Add(PgSqlAddNotifyInfo, Provider.Postgre);
|
|
return modelBuilder;
|
|
}
|
|
public static void MySqlAddNotifyInfo(this ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<NotifyInfo>(entity =>
|
|
{
|
|
entity.HasKey(e => e.NotifyId)
|
|
.HasName("PRIMARY");
|
|
|
|
entity.ToTable("notify_info");
|
|
|
|
entity.HasIndex(e => e.State)
|
|
.HasDatabaseName("state");
|
|
|
|
entity.Property(e => e.NotifyId).HasColumnName("notify_id");
|
|
|
|
entity.Property(e => e.Attempts).HasColumnName("attempts");
|
|
|
|
entity.Property(e => e.ModifyDate)
|
|
.HasColumnName("modify_date")
|
|
.HasColumnType("datetime");
|
|
|
|
entity.Property(e => e.Priority).HasColumnName("priority");
|
|
|
|
entity.Property(e => e.State).HasColumnName("state");
|
|
});
|
|
}
|
|
public static void PgSqlAddNotifyInfo(this ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<NotifyInfo>(entity =>
|
|
{
|
|
entity.HasKey(e => e.NotifyId)
|
|
.HasName("notify_info_pkey");
|
|
|
|
entity.ToTable("notify_info", "onlyoffice");
|
|
|
|
entity.HasIndex(e => e.State)
|
|
.HasDatabaseName("state");
|
|
|
|
entity.Property(e => e.NotifyId)
|
|
.HasColumnName("notify_id")
|
|
.ValueGeneratedNever();
|
|
|
|
entity.Property(e => e.Attempts).HasColumnName("attempts");
|
|
|
|
entity.Property(e => e.ModifyDate).HasColumnName("modify_date");
|
|
|
|
entity.Property(e => e.Priority).HasColumnName("priority");
|
|
|
|
entity.Property(e => e.State).HasColumnName("state");
|
|
});
|
|
}
|
|
}
|
|
}
|