فهرست منبع

Added DB update script for 9_0_1

Kenric Nugteren 1 ماه پیش
والد
کامیت
c2ee0def10

+ 1 - 0
prs.shared/Database Update Scripts/DatabaseUpdateScripts.cs

@@ -20,5 +20,6 @@ public static class DatabaseUpdateScripts
 {
     public static void RegisterScripts()
     {
+        DataUpdater.RegisterUpdateScript<Update_9_0_1>();
     }
 }

+ 24 - 0
prs.shared/Database Update Scripts/Update_9_0_1.cs

@@ -0,0 +1,24 @@
+using InABox.Database;
+using InABox.Database.SQLite;
+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_9_0_1 : DatabaseUpdateScript
+    {
+        public override VersionNumber Version => new(9, 0, 1);
+
+        public override bool Update()
+        {
+            if(DbFactory.ProviderFactory is SQLiteProviderFactory factory)
+            {
+                factory.DropRedundantTables();
+            }
+            return true;
+        }
+    }
+}