mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
Merge branch 'master' into careminster-presence-refactor
This commit is contained in:
@@ -43,6 +43,11 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
|
||||
public bool Delete(UUID principalID, string friend)
|
||||
{
|
||||
return Delete(principalID.ToString(), friend);
|
||||
}
|
||||
|
||||
public bool Delete(string principalID, string friend)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
@@ -64,5 +69,14 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(string principalID)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID LIKE ?PrincipalID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString() + '%');
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,12 @@ INSERT INTO `Friends` SELECT `ownerID`, `friendID`, `friendPerms`, 0 FROM `userf
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 3 # -------------------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE `Friends` DROP PRIMARY KEY;
|
||||
ALTER TABLE `Friends` ADD PRIMARY KEY(PrincipalID(36), Friend(36));
|
||||
ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT;
|
||||
|
||||
Reference in New Issue
Block a user