Pull up Assembly of the MySQL classes as a protected property, so that it can be overwritten in subclasses. That way extensions can decide in which assembly migration resources should be looked up. This is just a refactor -- no functional changes whatsoever.
parent
9b345ebf73
commit
9923a2ff10
|
@ -47,6 +47,11 @@ namespace OpenSim.Data.MySQL
|
||||||
private string m_connectionString;
|
private string m_connectionString;
|
||||||
private object m_dbLock = new object();
|
private object m_dbLock = new object();
|
||||||
|
|
||||||
|
protected virtual Assembly Assembly
|
||||||
|
{
|
||||||
|
get { return GetType().Assembly; }
|
||||||
|
}
|
||||||
|
|
||||||
#region IPlugin Members
|
#region IPlugin Members
|
||||||
|
|
||||||
public override string Version { get { return "1.0.0.0"; } }
|
public override string Version { get { return "1.0.0.0"; } }
|
||||||
|
@ -66,13 +71,10 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
m_connectionString = connect;
|
m_connectionString = connect;
|
||||||
|
|
||||||
// This actually does the roll forward assembly stuff
|
|
||||||
Assembly assem = GetType().Assembly;
|
|
||||||
|
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
Migration m = new Migration(dbcon, assem, "AssetStore");
|
Migration m = new Migration(dbcon, Assembly, "AssetStore");
|
||||||
m.Update();
|
m.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Reflection;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
@ -42,6 +43,11 @@ namespace OpenSim.Data.MySQL
|
||||||
private int m_LastExpire;
|
private int m_LastExpire;
|
||||||
// private string m_connectionString;
|
// private string m_connectionString;
|
||||||
|
|
||||||
|
protected virtual Assembly Assembly
|
||||||
|
{
|
||||||
|
get { return GetType().Assembly; }
|
||||||
|
}
|
||||||
|
|
||||||
public MySqlAuthenticationData(string connectionString, string realm)
|
public MySqlAuthenticationData(string connectionString, string realm)
|
||||||
: base(connectionString)
|
: base(connectionString)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +57,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
Migration m = new Migration(dbcon, GetType().Assembly, "AuthStore");
|
Migration m = new Migration(dbcon, Assembly, "AuthStore");
|
||||||
m.Update();
|
m.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,11 @@ namespace OpenSim.Data.MySQL
|
||||||
private Dictionary<string, FieldInfo> m_FieldMap =
|
private Dictionary<string, FieldInfo> m_FieldMap =
|
||||||
new Dictionary<string, FieldInfo>();
|
new Dictionary<string, FieldInfo>();
|
||||||
|
|
||||||
|
protected virtual Assembly Assembly
|
||||||
|
{
|
||||||
|
get { return GetType().Assembly; }
|
||||||
|
}
|
||||||
|
|
||||||
public MySQLEstateStore()
|
public MySQLEstateStore()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -82,8 +87,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
|
|
||||||
Assembly assem = GetType().Assembly;
|
Migration m = new Migration(dbcon, Assembly, "EstateStore");
|
||||||
Migration m = new Migration(dbcon, assem, "EstateStore");
|
|
||||||
m.Update();
|
m.Update();
|
||||||
|
|
||||||
Type t = typeof(EstateSettings);
|
Type t = typeof(EstateSettings);
|
||||||
|
|
|
@ -46,6 +46,11 @@ namespace OpenSim.Data.MySQL
|
||||||
protected string m_Realm;
|
protected string m_Realm;
|
||||||
protected FieldInfo m_DataField = null;
|
protected FieldInfo m_DataField = null;
|
||||||
|
|
||||||
|
protected virtual Assembly Assembly
|
||||||
|
{
|
||||||
|
get { return GetType().Assembly; }
|
||||||
|
}
|
||||||
|
|
||||||
public MySQLGenericTableHandler(string connectionString,
|
public MySQLGenericTableHandler(string connectionString,
|
||||||
string realm, string storeName) : base(connectionString)
|
string realm, string storeName) : base(connectionString)
|
||||||
{
|
{
|
||||||
|
@ -57,7 +62,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
Migration m = new Migration(dbcon, GetType().Assembly, storeName);
|
Migration m = new Migration(dbcon, Assembly, storeName);
|
||||||
m.Update();
|
m.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Data;
|
using OpenSim.Data;
|
||||||
|
@ -42,6 +44,11 @@ namespace OpenSim.Data.MySQL
|
||||||
private List<string> m_ColumnNames;
|
private List<string> m_ColumnNames;
|
||||||
//private string m_connectionString;
|
//private string m_connectionString;
|
||||||
|
|
||||||
|
protected virtual Assembly Assembly
|
||||||
|
{
|
||||||
|
get { return GetType().Assembly; }
|
||||||
|
}
|
||||||
|
|
||||||
public MySqlRegionData(string connectionString, string realm)
|
public MySqlRegionData(string connectionString, string realm)
|
||||||
: base(connectionString)
|
: base(connectionString)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +58,7 @@ namespace OpenSim.Data.MySQL
|
||||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||||
{
|
{
|
||||||
dbcon.Open();
|
dbcon.Open();
|
||||||
Migration m = new Migration(dbcon, GetType().Assembly, "GridStore");
|
Migration m = new Migration(dbcon, Assembly, "GridStore");
|
||||||
m.Update();
|
m.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,11 @@ namespace OpenSim.Data.MySQL
|
||||||
private string m_connectionString;
|
private string m_connectionString;
|
||||||
private object m_dbLock = new object();
|
private object m_dbLock = new object();
|
||||||
|
|
||||||
|
protected virtual Assembly Assembly
|
||||||
|
{
|
||||||
|
get { return GetType().Assembly; }
|
||||||
|
}
|
||||||
|
|
||||||
public MySQLSimulationData()
|
public MySQLSimulationData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -71,8 +76,7 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
// Apply new Migrations
|
// Apply new Migrations
|
||||||
//
|
//
|
||||||
Assembly assem = GetType().Assembly;
|
Migration m = new Migration(dbcon, Assembly, "RegionStore");
|
||||||
Migration m = new Migration(dbcon, assem, "RegionStore");
|
|
||||||
m.Update();
|
m.Update();
|
||||||
|
|
||||||
// Clean dropped attachments
|
// Clean dropped attachments
|
||||||
|
|
Loading…
Reference in New Issue