本文整理汇总了C#中Migration类的典型用法代码示例。如果您正苦于以下问题:C# Migration类的具体用法?C# Migration怎么用?C# Migration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Migration类属于命名空间,在下文中一共展示了Migration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Initialise
public void Initialise(string connectionString)
{
m_ConnectionString = connectionString;
m_Connection = new MySqlConnection(m_ConnectionString);
m_Connection.Open();
// Apply new Migrations
//
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_Connection, assem, "RegionStore");
m.Update();
// NOTE: This is a very slow query that times out on regions with a lot of prims.
// I'm told that it is no longer relevant so it's commented out now, but if it
// is relevant it should be added as a console command instead of part of the
// startup phase
// Clean dropped attachments
//
//try
//{
// using (MySqlCommand cmd = m_Connection.CreateCommand())
// {
// cmd.CommandText = "delete from prims, primshapes using prims " +
// "left join primshapes on prims.uuid = primshapes.uuid " +
// "where PCode = 9 and State <> 0";
// ExecuteNonQuery(cmd);
// }
//}
//catch (MySqlException ex)
//{
// m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
//}
}
开发者ID:dirkhusemann,项目名称:opensim,代码行数:35,代码来源:MySQLLegacyRegionData.cs
示例2: Init
public void Init()
{
SuperInit();
// If we manage to connect to the database with the user
// and password above it is our test database, and run
// these tests. If anything goes wrong, ignore these
// tests.
try
{
database = new MySQLManager(connect);
db = new MySQLGridData();
db.Initialise(connect);
}
catch (Exception e)
{
m_log.Error("Exception {0}", e);
Assert.Ignore();
}
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
using (MySqlConnection dbcon = new MySqlConnection(connect))
{
dbcon.Open();
Migration m = new Migration(dbcon, assem, "AssetStore");
m.Update();
}
}
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:29,代码来源:MySQLGridTest.cs
示例3: Add
/// <param name="migration">Migration parameter</param>
public void Add(Migration migration)
{
if (_migrations.Any(m => m.Type == migration.Type && m.Version == migration.Version))
throw new NotSupportedException("Migration versions for same type must differ");
_migrations.AddLast(migration);
}
开发者ID:skimur,项目名称:skimur,代码行数:8,代码来源:MigrationResources.cs
示例4: Initialise
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
m_connection = new SqliteConnection(m_connectionString);
try
{
m_connection.Open();
}
catch (Exception ex)
{
throw new Exception("SQLite has errored out on opening the database. If you are on a 64 bit system, please run OpenSim.32BitLaunch.exe and try again. If this is not a 64 bit error :" + ex);
}
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_connection, assem, "EstateStore");
m.Update();
//m_connection.Close();
// m_connection.Open();
Type t = typeof(EstateSettings);
m_Fields = t.GetFields(BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.DeclaredOnly);
foreach (FieldInfo f in m_Fields)
if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f;
}
开发者ID:NickyPerian,项目名称:Aurora,代码行数:32,代码来源:SQLiteEstateData.cs
示例5: Initialise
/// <summary>
/// Initialises the estatedata class.
/// </summary>
/// <param name="connectionString">connectionString.</param>
public void Initialise(string connectionString)
{
if (!string.IsNullOrEmpty(connectionString))
{
m_connectionString = connectionString;
_Database = new PGSQLManager(connectionString);
}
//Migration settings
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
{
conn.Open();
Migration m = new Migration(conn, GetType().Assembly, "EstateStore");
m.Update();
}
//Interesting way to get parameters! Maybe implement that also with other types
Type t = typeof(EstateSettings);
_Fields = t.GetFields(BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.DeclaredOnly);
foreach (FieldInfo f in _Fields)
{
if (f.Name.Substring(0, 2) == "m_")
_FieldMap[f.Name.Substring(2)] = f;
}
}
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:32,代码来源:PGSQLEstateData.cs
示例6: Initialise
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
m_connection = new SqliteConnection(m_connectionString);
m_connection.Open();
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_connection, assem, "EstateStore");
m.Update();
//m_connection.Close();
// m_connection.Open();
Type t = typeof(EstateSettings);
m_Fields = t.GetFields(BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.DeclaredOnly);
foreach (FieldInfo f in m_Fields)
if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f;
}
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:25,代码来源:SQLiteEstateData.cs
示例7: Initialise
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
// Apply new Migrations
//
Assembly assem = GetType().Assembly;
Migration m = new Migration(dbcon, assem, "RegionStore");
m.Update();
// Clean dropped attachments
//
try
{
using (MySqlCommand cmd = dbcon.CreateCommand())
{
cmd.CommandText = "delete from prims, primshapes using prims " +
"left join primshapes on prims.uuid = primshapes.uuid " +
"where PCode = 9 and State <> 0";
ExecuteNonQuery(cmd);
}
}
catch (MySqlException ex)
{
m_log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
}
}
}
开发者ID:mcortez,项目名称:opensim,代码行数:32,代码来源:MySQLLegacyRegionData.cs
示例8: Initialise
/// <summary>
/// Initialises the region datastore
/// </summary>
/// <param name="connectionString">The connection string.</param>
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
_Database = new MSSQLManager(connectionString);
using (SqlConnection conn = new SqlConnection(connectionString))
{
conn.Open();
//New Migration settings
Migration m = new Migration(conn, Assembly, "RegionStore");
m.Update();
// Clean dropped attachments
//
try
{
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "delete from prims where prims.UUID in (select UUID from primshapes where PCode = 9 and State <> 0); delete from primshapes where PCode = 9 and State <> 0";
cmd.ExecuteNonQuery();
}
}
catch (Exception ex)
{
_Log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
}
}
}
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:32,代码来源:MSSQLSimulationData.cs
示例9: Initialise
/// <summary>
/// Artificial constructor called when the plugin is loaded
/// Uses the obsolete mysql_connection.ini if connect string is empty.
/// </summary>
/// <param name="connect">connect string</param>
public void Initialise(string connect)
{
if (connect != String.Empty)
{
database = new MySQLManager(connect);
}
else
{
m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead");
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword,
settingPooling, settingPort);
}
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration(database.Connection, assem, "LogStore");
// TODO: After rev 6000, remove this. People should have
// been rolled onto the new migration code by then.
TestTables(m);
m.Update();
}
开发者ID:ChrisD,项目名称:opensim,代码行数:38,代码来源:MySQLLogData.cs
示例10: Initialise
public void Initialise(string connectionString)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
m_connectionString = connectionString;
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
m_connection = new SqliteConnection(m_connectionString);
m_connection.Open();
Migration m = new Migration(m_connection, Assembly, "EstateStore");
m.Update();
//m_connection.Close();
// m_connection.Open();
Type t = typeof(EstateSettings);
m_Fields = t.GetFields(BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.DeclaredOnly);
foreach (FieldInfo f in m_Fields)
if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f;
}
开发者ID:JAllard,项目名称:opensim,代码行数:27,代码来源:SQLiteEstateData.cs
示例11: Initialise
public void Initialise(string connectionString)
{
m_connectionString = connectionString;
try
{
m_log.Info("[REGION DB]: MySql - connecting: " + Util.GetDisplayConnectionString(m_connectionString));
}
catch (Exception e)
{
m_log.Debug("Exception: password not found in connection string\n" + e.ToString());
}
GetWaitTimeout();
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
Assembly assem = GetType().Assembly;
Migration m = new Migration(dbcon, assem, "EstateStore");
m.Update();
Type t = typeof(EstateSettings);
m_Fields = t.GetFields(BindingFlags.NonPublic |
BindingFlags.Instance |
BindingFlags.DeclaredOnly);
foreach (FieldInfo f in m_Fields)
{
if (f.Name.Substring(0, 2) == "m_")
m_FieldMap[f.Name.Substring(2)] = f;
}
}
}
开发者ID:dreamerc,项目名称:diva-distribution,代码行数:35,代码来源:MySQLEstateData.cs
示例12: MySqlUserAccountData
public MySqlUserAccountData(string connectionString, string realm)
: base(connectionString)
{
m_Realm = realm;
Migration m = new Migration(m_Connection, GetType().Assembly, "UserStore");
m.Update();
}
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:8,代码来源:MySQLUserAccountData.cs
示例13: SQLiteGenericData
public SQLiteGenericData(string connectionString)
{
m_Connection = new SqliteConnection(connectionString);
m_Connection.Open();
Migration m = new Migration(m_Connection, this.GetType().Assembly, "GenericStore");
m.Update();
}
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:8,代码来源:SQLiteGenericData.cs
示例14: MySqlRegionData
// private int m_LastExpire = 0;
public MySqlRegionData(string connectionString, string realm)
: base(connectionString)
{
m_Realm = realm;
Migration m = new Migration(m_Connection, GetType().Assembly, "GridStore");
m.Update();
}
开发者ID:dirkhusemann,项目名称:opensim,代码行数:10,代码来源:MySQLRegionData.cs
示例15: DeleteSuccessfullRollback
public void DeleteSuccessfullRollback(Migration migration, System.Data.IDbConnection openConnection)
{
using (SqlCommand cmd = new SqlCommand(@"DELETE FROM [DBAppliedMigrations]
WHERE [Migration_id][email protected]", (SqlConnection)openConnection))
{
cmd.Parameters.Add(new SqlParameter("migrationId", migration.Id));
cmd.ExecuteNonQuery();
}
}
开发者ID:julienblin,项目名称:Colibri,代码行数:9,代码来源:SqlServerDBMigrationTablesManager.cs
示例16: Should_Add_Migration
public void Should_Add_Migration()
{
var migration = new Migration();
migration.Version = "0.0";
var migrationsService = new MigrationsService();
migrationsService.Register(migration);
migrationsService.Migrations.Contains(migration).Should().BeTrue("because we just added this migration");
}
开发者ID:nathantreid,项目名称:MigrateIt,代码行数:10,代码来源:Migrations_Tests.cs
示例17: MSSQLGenericData
public MSSQLGenericData(string connectionString)
{
m_ConnectionString = connectionString;
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
{
conn.Open();
Migration m = new Migration(conn, GetType().Assembly, "GenericStore");
m.Update();
}
}
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:10,代码来源:MSSQLGenericData.cs
示例18: Init
void Init()
{
using (NpgsqlConnection dbcon = new NpgsqlConnection(ConnectionString))
{
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "UserProfiles");
m.Update();
}
}
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:10,代码来源:PGSQLUserProfilesData.cs
示例19: MSSQLUserAccountData
public MSSQLUserAccountData(string connectionString, string realm)
{
m_Realm = realm;
m_ConnectionString = connectionString;
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
{
conn.Open();
Migration m = new Migration(conn, GetType().Assembly, "UserStore");
m.Update();
}
}
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:11,代码来源:MSSQLUserAccountData.cs
示例20: MySqlGenericData
public MySqlGenericData(string connect)
{
m_connectionString = connect;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
Migration m = new Migration(dbcon, this.GetType().Assembly, "GenericStore");
m.Update();
}
}
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:11,代码来源:MySQLGenericData.cs
注:本文中的Migration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论