forked from gongxuegit/tiku-backend.net
feat: 添加租户隔离保护触发器的管理方法,并更新迁移文档
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace Tiku.Infrastructure.Persistence.Migrations;
|
||||
|
||||
internal static class MigrationBuilderTenantGuardExtensions
|
||||
{
|
||||
public static void EnsureTenantIsolationGuards(this MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(PostgreSqlTenantConstraintSql.DropTenantGuards);
|
||||
migrationBuilder.Sql(PostgreSqlTenantConstraintSql.CreateTenantQuestionReferenceGuard);
|
||||
migrationBuilder.Sql(PostgreSqlTenantConstraintSql.CreateTaxonomyParentGuard);
|
||||
}
|
||||
|
||||
public static void DropTenantIsolationGuards(this MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(PostgreSqlTenantConstraintSql.DropTenantGuards);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user