using Comal.Classes; using InABox.Core; using InABox.Database; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PRS.Shared.Database_Update_Scripts; internal class Update_8_34 : DatabaseUpdateScript { public override VersionNumber Version => new(8, 34); private static void DoEventNotificationsEnabled() { var provider = DbFactory.NewProvider(Logger.Main); Logger.Send(LogType.Information, "", $"Initialising Event.NotificationsEnabled to true..."); var events = provider.Query( null, Columns.None().Add(x => x.ID).Add(x => x.NotificationsEnabled)) .ToArray(); foreach(var ev in events) { ev.NotificationsEnabled = true; } provider.Save(events); Logger.Send(LogType.Information, "", $"Initialised Event.NotificationsEnabled to true"); } public override bool Update() { DoEventNotificationsEnabled(); return true; } }