diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLLogData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLogData.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index 2bd246a..2e6de7c 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs | |||
@@ -65,6 +65,36 @@ namespace OpenSim.Data.MySQL | |||
65 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, | 65 | database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, |
66 | settingPooling, settingPort); | 66 | settingPooling, settingPort); |
67 | } | 67 | } |
68 | |||
69 | // This actually does the roll forward assembly stuff | ||
70 | Assembly assem = GetType().Assembly; | ||
71 | Migration m = new Migration(database.Connection, assem, "LogStore"); | ||
72 | |||
73 | // TODO: After rev 6000, remove this. People should have | ||
74 | // been rolled onto the new migration code by then. | ||
75 | TestTables(m); | ||
76 | |||
77 | m.Update(); | ||
78 | |||
79 | } | ||
80 | |||
81 | private void TestTables(Migration m) | ||
82 | { | ||
83 | // under migrations, bail | ||
84 | if (m.Version > 0) | ||
85 | return; | ||
86 | |||
87 | Dictionary<string, string> tableList = new Dictionary<string, string>(); | ||
88 | tableList["logs"] = null; | ||
89 | database.GetTableVersion(tableList); | ||
90 | |||
91 | // migrations will handle it | ||
92 | if (tableList["logs"] == null) | ||
93 | return; | ||
94 | |||
95 | // we have the table, so pretend like we did the first migration in the past | ||
96 | if (m.Version == 0) | ||
97 | m.Version = 1; | ||
68 | } | 98 | } |
69 | 99 | ||
70 | /// <summary> | 100 | /// <summary> |