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);
    }
}
