Skip to content

Commit

Permalink
Remove CharacterNameLegacyMode (#2753)
Browse files Browse the repository at this point in the history
  • Loading branch information
leotsarev authored Aug 15, 2024
1 parent aa3c2f5 commit 6d74517
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 14 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace JoinRpg.Dal.Impl.Migrations
{
using System.Data.Entity.Migrations;

public partial class RemoveCharacterNameLegacyMode : DbMigration
{
public override void Up()
{
DropColumn("dbo.ProjectDetails", "CharacterNameLegacyMode");
}

public override void Down()
{
AddColumn("dbo.ProjectDetails", "CharacterNameLegacyMode", c => c.Boolean(nullable: false));
}
}
}

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions src/JoinRpg.DataModel/Projects/ProjectDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ public class ProjectDetails : IValidatableObject
public bool AutoAcceptClaims { get; set; } = false;
public bool EnableAccommodation { get; set; } = false;

/// <summary>
/// If true, character name is separate property of character, not bound to any field
/// and could be edited only by master
/// </summary>
[Obsolete("Not used any more, will be deleted soon")]
public bool CharacterNameLegacyMode { get; set; } = true;
/// <summary>
/// Null = bound to player name
/// Other value = bound to that field
Expand Down
10 changes: 2 additions & 8 deletions src/JoinRpg.Services.Impl/ProjectService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ public async Task<Project> AddProject(ProjectName projectName, string rootCharac
AvaiableDirectSlots = 0,
};
MarkCreatedNow(rootGroup);
#pragma warning disable CS0618 // Type or member is obsolete
var projectDetails = new ProjectDetails()
{
//Flag will be removed later, now it should always be false
CharacterNameLegacyMode = false,
};
#pragma warning restore CS0618 // Type or member is obsolete

var project = new Project()
{
Active = true,
Expand All @@ -47,7 +41,7 @@ public async Task<Project> AddProject(ProjectName projectName, string rootCharac
ProjectName = projectName,
CharacterGroups = [rootGroup,],
ProjectAcls = [ProjectAcl.CreateRootAcl(CurrentUserId, isOwner: true),],
Details = projectDetails,
Details = new ProjectDetails(),
ProjectFields = [],
};
MarkTreeModified(project);
Expand Down

0 comments on commit 6d74517

Please sign in to comment.