remove unique index of TenantId and Name from Site table as site name does not need to be unique. Remove TenantId column from Site table as it is not necessary and should be obtained from the Alias.

This commit is contained in:
sbwalker
2025-12-03 15:28:31 -05:00
parent ad993c6180
commit 23d14c62a5
6 changed files with 49 additions and 17 deletions

View File

@@ -16,11 +16,6 @@ namespace Oqtane.Models
/// </summary>
public int SiteId { get; set; }
/// <summary>
/// Reference to the <see cref="Tenant"/> the Site is in
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// The site Name
/// </summary>
@@ -203,12 +198,17 @@ namespace Oqtane.Models
[NotMapped]
public string Fingerprint { get; set; }
/// <summary>
/// Reference to the <see cref="Tenant"/> the Site belongs to
/// </summary>
[NotMapped]
public int TenantId { get; set; }
public Site Clone()
{
return new Site
{
SiteId = SiteId,
TenantId = TenantId,
Name = Name,
TimeZoneId = TimeZoneId,
LogoFileId = LogoFileId,
@@ -246,7 +246,8 @@ namespace Oqtane.Models
Pages = Pages.ConvertAll(page => page.Clone()),
Languages = Languages.ConvertAll(language => language.Clone()),
Themes = Themes,
Fingerprint = Fingerprint
Fingerprint = Fingerprint,
TenantId = TenantId
};
}