add support for public content folders
This commit is contained in:
@ -231,7 +231,6 @@ namespace Oqtane.Migrations.EntityBuilders
|
||||
public void DeleteFromTable(string condition = "")
|
||||
{
|
||||
var deleteSql = $"DELETE FROM {RewriteName(EntityTableName)} ";
|
||||
|
||||
if(!string.IsNullOrEmpty(condition))
|
||||
{
|
||||
deleteSql += $"WHERE {condition}";
|
||||
@ -241,11 +240,8 @@ namespace Oqtane.Migrations.EntityBuilders
|
||||
|
||||
public void UpdateColumn(string columnName, string value, string condition = "")
|
||||
{
|
||||
var updateValue = value;
|
||||
|
||||
var updateSql = $"UPDATE {RewriteName(EntityTableName)} SET {RewriteName(columnName)} = {value} ";
|
||||
|
||||
if(!string.IsNullOrEmpty(condition))
|
||||
if (!string.IsNullOrEmpty(condition))
|
||||
{
|
||||
updateSql += $"WHERE {condition}";
|
||||
}
|
||||
|
34
Oqtane.Server/Migrations/Tenant/02010003_AddFolderType.cs
Normal file
34
Oqtane.Server/Migrations/Tenant/02010003_AddFolderType.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Oqtane.Databases.Interfaces;
|
||||
using Oqtane.Migrations.EntityBuilders;
|
||||
using Oqtane.Repository;
|
||||
using Oqtane.Shared;
|
||||
|
||||
namespace Oqtane.Migrations.Tenant
|
||||
{
|
||||
[DbContext(typeof(TenantDBContext))]
|
||||
[Migration("Tenant.02.01.00.03")]
|
||||
public class AddFolderType : MultiDatabaseMigration
|
||||
{
|
||||
public AddFolderType(IDatabase database) : base(database)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
var folderEntityBuilder = new FolderEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||
|
||||
//Add Type column and initialize
|
||||
folderEntityBuilder.AddStringColumn("Type", 50, true, true);
|
||||
folderEntityBuilder.UpdateColumn("Type", "'" + FolderTypes.Private + "'");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
var folderEntityBuilder = new FolderEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||
|
||||
folderEntityBuilder.DropColumn("Type");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user