From a22f007246598a7f81eafa254a200c21886ce648 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 18 Sep 2010 03:37:10 +0100 Subject: [PATCH] Improve the explanative text of migration failures When running for the first time, people see migration failures because of sql statements that are trying to move data from old tables (e.g. users). The amended text attempts to calm their nerves. --- OpenSim/Data/Migration.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index fc9a1429ec..2895a71581 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -138,12 +138,12 @@ namespace OpenSim.Data /// /// Array of strings, one-per-batch (often just one) protected virtual void ExecuteScript(DbConnection conn, string[] script) - { + { using (DbCommand cmd = conn.CreateCommand()) { cmd.CommandTimeout = 0; foreach (string sql in script) - { + { cmd.CommandText = sql; try { @@ -204,7 +204,7 @@ namespace OpenSim.Data catch (Exception e) { m_log.DebugFormat("[MIGRATIONS]: Cmd was {0}", e.Message.Replace("\n", " ")); - m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing."); + m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. If you're running OpenSim for the first time then you can probably safely ignore this, since certain migration commands attempt to fetch data out of old tables. However, if you're using an existing database and you see database related errors while running OpenSim then you will need to fix these problems manually. Continuing."); ExecuteScript("ROLLBACK;"); }