DocSpace-client/common/ASC.Core.Common/EF/Model/Feed/FeedReaded.cs

86 lines
2.8 KiB
C#
Raw Normal View History

2019-12-10 10:01:45 +00:00
using System;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace ASC.Core.Common.EF.Model
{
[Table("feed_readed")]
2019-12-17 13:01:59 +00:00
public class FeedReaded : BaseEntity
2019-12-10 10:01:45 +00:00
{
[Column("user_id")]
public Guid UserId { get; set; }
public DateTime TimeStamp { get; set; }
public string Module { get; set; }
[Column("tenant_id")]
public int Tenant { get; set; }
2019-12-17 13:01:59 +00:00
2020-02-21 12:38:04 +00:00
public override object[] GetKeys()
2019-12-17 13:01:59 +00:00
{
return new object[] { Tenant, UserId, Module };
}
2019-12-10 10:01:45 +00:00
}
public static class FeedReadedExtension
{
2020-09-06 22:49:03 +00:00
public static ModelBuilderWrapper AddFeedReaded(this ModelBuilderWrapper modelBuilder)
2019-12-10 10:01:45 +00:00
{
2020-09-06 22:49:03 +00:00
modelBuilder
.Add(MySqlAddFeedReaded, Provider.MySql)
2020-10-08 09:07:05 +00:00
.Add(PgSqlAddFeedReaded, Provider.Postgre);
2019-12-10 10:01:45 +00:00
return modelBuilder;
}
2020-09-06 22:49:03 +00:00
public static void MySqlAddFeedReaded(this ModelBuilder modelBuilder)
2019-12-10 10:01:45 +00:00
{
2020-08-21 02:34:37 +00:00
modelBuilder.Entity<FeedReaded>(entity =>
{
entity.HasKey(e => new { e.Tenant, e.UserId, e.Module })
.HasName("PRIMARY");
2019-12-10 10:01:45 +00:00
2020-08-21 02:34:37 +00:00
entity.ToTable("feed_readed");
entity.Property(e => e.Tenant).HasColumnName("tenant_id");
entity.Property(e => e.UserId)
.HasColumnName("user_id")
.HasColumnType("varchar(38)")
.HasCharSet("utf8")
.HasCollation("utf8_general_ci");
entity.Property(e => e.Module)
.HasColumnName("module")
.HasColumnType("varchar(50)")
.HasCharSet("utf8")
.HasCollation("utf8_general_ci");
entity.Property(e => e.TimeStamp)
.HasColumnName("timestamp")
.HasColumnType("datetime");
});
Merge branch 'master' into feature/fix-messages # Conflicts: # common/ASC.Core.Common/Billing/TariffService.cs # common/ASC.Core.Common/EF/Context/BaseDbContext.cs # common/ASC.Core.Common/EF/Context/CoreDbContext.cs # common/ASC.Core.Common/EF/Context/DbContext.cs # common/ASC.Core.Common/EF/Context/DbContextManager.cs # common/ASC.Core.Common/EF/Context/FeedDbContext.cs # common/ASC.Core.Common/EF/Context/FilesDbContext.cs # common/ASC.Core.Common/EF/Context/MessagesContext.cs # common/ASC.Core.Common/EF/Context/ResourceDbContext.cs # common/ASC.Core.Common/EF/Context/TelegramDbContext.cs # common/ASC.Core.Common/EF/Context/WebstudioDbContext.cs # common/ASC.Core.Common/EF/Model/AccountLinks.cs # common/ASC.Core.Common/EF/Model/Core/Acl.cs # common/ASC.Core.Common/EF/Model/Core/DbCoreSettings.cs # common/ASC.Core.Common/EF/Model/Core/DbSubscriptionMethod.cs # common/ASC.Core.Common/EF/Model/Core/Subscription.cs # common/ASC.Core.Common/EF/Model/DbWebstudioSettings.cs # common/ASC.Core.Common/EF/Model/DbWebstudioUservisit.cs # common/ASC.Core.Common/EF/Model/Feed/FeedReaded.cs # common/ASC.Core.Common/EF/Model/Feed/FeedUsers.cs # common/ASC.Core.Common/EF/Model/FilesConverts.cs # common/ASC.Core.Common/EF/Model/MobileAppInstall.cs # common/ASC.Core.Common/EF/Model/Resource/ResAuthorsFile.cs # common/ASC.Core.Common/EF/Model/Resource/ResAuthorsLang.cs # common/ASC.Core.Common/EF/Model/TelegramUser.cs # common/ASC.Core.Common/EF/Model/Tenant/DbButton.cs # common/ASC.Core.Common/EF/Model/Tenant/DbQuotaRow.cs # common/ASC.Core.Common/EF/Model/User/UserGroup.cs # common/ASC.Core.Common/HostedSolution.cs # common/ASC.Core.Common/Security/EmailValidationKeyProvider.cs # common/ASC.Data.Reassigns/QueueWorker.cs # common/ASC.Data.Reassigns/ReassignProgressItem.cs # common/ASC.Data.Reassigns/RemoveProgressItem.cs # common/ASC.VoipService/Dao/CachedVoipDao.cs # products/ASC.Files/Core/Core/Dao/TeamlabDao/DaoFactory.cs # products/ASC.Files/Core/Core/Dao/TeamlabDao/FileDao.cs # products/ASC.Files/Core/Core/Dao/TeamlabDao/FolderDao.cs # products/ASC.Files/Core/Core/EF/DbEncryptedData.cs # products/ASC.Files/Core/Core/EF/DbFile.cs # products/ASC.Files/Core/Core/EF/DbFilesBunchObjects.cs # products/ASC.Files/Core/Core/EF/DbFilesSecurity.cs # products/ASC.Files/Core/Core/EF/DbFilesTagLink.cs # products/ASC.Files/Core/Core/EF/DbFilesThirdpartyApp.cs # products/ASC.Files/Core/Core/EF/DbFilesThirdpartyIdMapping.cs # products/ASC.Files/Core/Core/EF/DbFolderTree.cs # products/ASC.Files/Core/Core/Search/FactoryIndexerFile.cs # products/ASC.Files/Core/Core/Search/FactoryIndexerFolder.cs # products/ASC.Files/Core/Core/Thirdparty/CachedProviderAccountDao.cs # products/ASC.Files/Core/Core/Thirdparty/ProviderDao/ProviderSecutiryDao.cs # products/ASC.Files/Core/Core/Thirdparty/ProviderDao/ProviderTagDao.cs # products/ASC.Files/Core/Utils/EntryManager.cs # products/ASC.Files/Server/Startup.cs # web/ASC.Web.Studio/Startup.cs
2020-10-09 12:40:44 +00:00
}
2020-09-06 22:49:03 +00:00
public static void PgSqlAddFeedReaded(this ModelBuilder modelBuilder)
2020-08-21 02:34:37 +00:00
{
modelBuilder.Entity<FeedReaded>(entity =>
{
entity.HasKey(e => new { e.UserId, e.Tenant, e.Module })
.HasName("feed_readed_pkey");
entity.ToTable("feed_readed", "onlyoffice");
entity.Property(e => e.UserId)
.HasColumnName("user_id")
.HasMaxLength(38);
entity.Property(e => e.Tenant).HasColumnName("tenant_id");
entity.Property(e => e.Module)
.HasColumnName("module")
.HasMaxLength(50);
entity.Property(e => e.TimeStamp).HasColumnName("timestamp");
});
2019-12-10 10:01:45 +00:00
}
}
}