mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
37 lines
1.3 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System;
|
|
using System.Linq;
|
|
using Squidex.Domain.Apps.Core.Rules;
|
|
using Squidex.Domain.Apps.Core.Rules.Triggers;
|
|
using Squidex.Infrastructure.Collections;
|
|
using Squidex.Infrastructure.Migrations;
|
|
using Squidex.Infrastructure.Reflection;
|
|
|
|
namespace Migrations.OldTriggers
|
|
{
|
|
[TypeName(nameof(ContentChangedTrigger))]
|
|
public sealed record ContentChangedTrigger : RuleTrigger, IMigrated<RuleTrigger>
|
|
{
|
|
public ReadonlyList<ContentChangedTriggerSchema> Schemas { get; set; }
|
|
|
|
public bool HandleAll { get; set; }
|
|
|
|
public override T Accept<T>(IRuleTriggerVisitor<T> visitor)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
public RuleTrigger Migrate()
|
|
{
|
|
var schemas = Schemas.Select(x => x.Migrate()).ToReadonlyList();
|
|
|
|
return new ContentChangedTriggerV2 { HandleAll = HandleAll, Schemas = schemas };
|
|
}
|
|
}
|
|
}
|
|
|