More commits for db read/write split
This commit is contained in:
@@ -41,13 +41,13 @@ namespace Activizr.Logic.Special.Sweden
|
||||
throw new HandleException(newHandle, HandleErrorType.HandleNotFound);
|
||||
}
|
||||
|
||||
int[] members = PirateDb.GetDatabase().GetObjectsByOptionalData(ObjectType.Person, ObjectOptionalDataType.ForumAccountId, "" + newHandleAccountId);
|
||||
int[] members = PirateDb.GetDatabaseForReading().GetObjectsByOptionalData(ObjectType.Person, ObjectOptionalDataType.ForumAccountId, "" + newHandleAccountId);
|
||||
if (members.Length > 1 || (members.Length == 1 && members[0] != personId))
|
||||
{
|
||||
throw new HandleException(newHandle, HandleErrorType.HandleOccupied);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int currentAccountId = person.SwedishForumAccountId;
|
||||
|
||||
// Remove "party member" status from this account
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Activizr.Utility.BotCode
|
||||
match = match.NextMatch();
|
||||
}
|
||||
|
||||
PirateDb.GetDatabase().StoreBlogTopList(DateTime.Today, rankingList.ToArray());
|
||||
PirateDb.GetDatabaseForWriting().StoreBlogTopList(DateTime.Today, rankingList.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace Activizr.Utility.Migrations
|
||||
{
|
||||
public static void Migrate()
|
||||
{
|
||||
PirateDb db = PirateDb.GetDatabase();
|
||||
PirateDb db = PirateDb.GetDatabaseForAdmin();
|
||||
|
||||
using (DbConnection connection = db.GetSqlServerDbConnection())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user