From 6d2bc0eb7219dccc6799af87ba93c22043846fea Mon Sep 17 00:00:00 2001 From: TidusJar Date: Fri, 11 Nov 2016 20:59:50 +0000 Subject: [PATCH] Migrate users --- .../Migrations/Version1100.cs | 20 +++++++++++++++++-- appveyor.yml | 6 +++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/PlexRequests.Core.Migration/Migrations/Version1100.cs b/PlexRequests.Core.Migration/Migrations/Version1100.cs index fe03daf88..804dfa438 100644 --- a/PlexRequests.Core.Migration/Migrations/Version1100.cs +++ b/PlexRequests.Core.Migration/Migrations/Version1100.cs @@ -27,23 +27,27 @@ using System.Data; using PlexRequests.Store; +using PlexRequests.Store.Repository; namespace PlexRequests.Core.Migration.Migrations { [Migration(11000, "v1.10.0.0")] public class Version1100 : BaseMigration, IMigration { - public Version1100() + public Version1100(IUserRepository userRepo) { } public int Version => 11000; - + public IUserRepository UserRepo {get;set;} public void Start(IDbConnection con) { UpdateDb(con); + // Update the current admin permissions set + UpdateAdmin(con); + UpdateSchema(con, Version); } @@ -54,5 +58,17 @@ namespace PlexRequests.Core.Migration.Migrations con.AlterTable("Users", "ADD", "Features", true, "INTEGER"); } + + private void UpdateAdmin(IDbConnection con) + { + var users = UserRepo.GetAll(); + + foreach (var user in users) + { + user.Permissions = Permissions.Administrator | ReportIssue | RequestMusic + | RequestTvShow + | RequestMovie; + } + } } } \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 1af2ba46a..4f00bdb6f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,11 +1,11 @@ -version: 1.9.{build} +version: 1.10.{build} configuration: Release assembly_info: patch: true file: '**\AssemblyInfo.*' - assembly_version: '1.9.7' + assembly_version: '1.10.0' assembly_file_version: '{version}' - assembly_informational_version: '1.9.7' + assembly_informational_version: '1.10.0' before_build: - cmd: appveyor-retry nuget restore build: