2022-02-15 11:52:43 +00:00
|
|
|
|
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
|
2019-12-10 13:42:29 +00:00
|
|
|
|
{
|
2022-02-15 11:52:43 +00:00
|
|
|
|
public static ModelBuilderWrapper AddNotifyInfo(this ModelBuilderWrapper modelBuilder)
|
2019-12-10 13:42:29 +00:00
|
|
|
|
{
|
2022-02-15 11:52:43 +00:00
|
|
|
|
modelBuilder
|
|
|
|
|
.Add(MySqlAddNotifyInfo, Provider.MySql)
|
|
|
|
|
.Add(PgSqlAddNotifyInfo, Provider.PostgreSql);
|
|
|
|
|
|
|
|
|
|
return modelBuilder;
|
2019-12-10 13:42:29 +00:00
|
|
|
|
}
|
2022-02-15 11:52:43 +00:00
|
|
|
|
public static void MySqlAddNotifyInfo(this ModelBuilder modelBuilder)
|
2020-08-21 02:34:37 +00:00
|
|
|
|
{
|
2022-02-15 11:52:43 +00:00
|
|
|
|
modelBuilder.Entity<NotifyInfo>(entity =>
|
2020-09-06 22:49:03 +00:00
|
|
|
|
{
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.HasKey(e => e.NotifyId)
|
|
|
|
|
.HasName("PRIMARY");
|
2022-02-14 21:02:57 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.ToTable("notify_info");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.HasIndex(e => e.State)
|
|
|
|
|
.HasDatabaseName("state");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.NotifyId).HasColumnName("notify_id");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.Attempts).HasColumnName("attempts");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.ModifyDate)
|
|
|
|
|
.HasColumnName("modify_date")
|
|
|
|
|
.HasColumnType("datetime");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.Priority).HasColumnName("priority");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.State).HasColumnName("state");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
public static void PgSqlAddNotifyInfo(this ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
modelBuilder.Entity<NotifyInfo>(entity =>
|
2020-08-21 02:34:37 +00:00
|
|
|
|
{
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.HasKey(e => e.NotifyId)
|
|
|
|
|
.HasName("notify_info_pkey");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.ToTable("notify_info", "onlyoffice");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.HasIndex(e => e.State)
|
|
|
|
|
.HasDatabaseName("state");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.NotifyId)
|
|
|
|
|
.HasColumnName("notify_id")
|
|
|
|
|
.ValueGeneratedNever();
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.Attempts).HasColumnName("attempts");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.ModifyDate).HasColumnName("modify_date");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.Priority).HasColumnName("priority");
|
2020-08-21 02:34:37 +00:00
|
|
|
|
|
2022-02-15 11:52:43 +00:00
|
|
|
|
entity.Property(e => e.State).HasColumnName("state");
|
|
|
|
|
});
|
2020-08-21 02:34:37 +00:00
|
|
|
|
}
|
2019-12-10 13:42:29 +00:00
|
|
|
|
}
|