fix #5897 - allow SQLite to drop columns, remove deprecated columns, and handle upgrade logic

This commit is contained in:
sbwalker
2025-12-19 09:03:44 -05:00
parent 1682a123b4
commit a10575bfc3
13 changed files with 105 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using Oqtane.Shared;
namespace Oqtane.Models
@@ -55,13 +56,6 @@ namespace Oqtane.Models
/// </summary>
public string Description { get; set; }
/// <summary>
/// Deprecated
/// Note that this property still exists in the database because columns cannot be dropped in SQLite
/// Therefore the property must be retained/mapped even though the framework no longer uses it
/// </summary>
public bool? IsDeleted { get; set; }
/// <summary>
/// Object reference to the <see cref="Folder"/> object.
/// Use this if you need to determine what <see cref="Site"/> the file belongs to.
@@ -74,5 +68,16 @@ namespace Oqtane.Models
/// </summary>
[NotMapped]
public string Url { get; set; }
#region Deprecated Properties
[Obsolete("The IsDeleted property is deprecated. Soft delete of files is not supported.", false)]
[NotMapped]
[JsonIgnore] // exclude from API payload
public bool? IsDeleted { get; set; }
#endregion
}
}

View File

@@ -67,13 +67,6 @@ namespace Oqtane.Models
/// </summary>
public string CacheControl { get; set; }
/// <summary>
/// Deprecated
/// Note that this property still exists in the database because columns cannot be dropped in SQLite
/// Therefore the property must be retained/mapped even though the framework no longer uses it
/// </summary>
public bool? IsDeleted { get; set; }
/// <summary>
/// TODO: todoc what would this contain?
/// </summary>
@@ -110,6 +103,11 @@ namespace Oqtane.Models
}
}
[Obsolete("The IsDeleted property is deprecated. Soft delete of folders is not supported.", false)]
[NotMapped]
[JsonIgnore] // exclude from API payload
public bool? IsDeleted { get; set; }
#endregion
}
}

View File

@@ -31,9 +31,8 @@ namespace Oqtane.Models
/// <summary>
/// Language Name - corresponds to <see cref="Culture.DisplayName"/>, _not_ <see cref="Culture.Name"/>
/// Note that this property still exists in the database because columns cannot be dropped in SQLite
/// Therefore the property must be retained/mapped even though the framework populates it from the Culture API
/// </summary>
[NotMapped]
public string Name { get; set; }
[NotMapped]