aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/NHibernate/NHibernateAssetData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/NHibernate/NHibernateAssetData.cs')
-rw-r--r--OpenSim/Data/NHibernate/NHibernateAssetData.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
index 7163a92..bb5a3f3 100644
--- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs
+++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs
@@ -66,17 +66,21 @@ namespace OpenSim.Data.NHibernate
66 throw new Exception("Malformed Inventory connection string '" + connect + "'"); 66 throw new Exception("Malformed Inventory connection string '" + connect + "'");
67 } 67 }
68 68
69 string dialect = parts[0];
70
69 // NHibernate setup 71 // NHibernate setup
70 cfg = new Configuration(); 72 cfg = new Configuration();
71 cfg.SetProperty(Environment.ConnectionProvider, 73 cfg.SetProperty(Environment.ConnectionProvider,
72 "NHibernate.Connection.DriverConnectionProvider"); 74 "NHibernate.Connection.DriverConnectionProvider");
73 cfg.SetProperty(Environment.Dialect, 75 cfg.SetProperty(Environment.Dialect,
74 "NHibernate.Dialect." + parts[0]); 76 "NHibernate.Dialect." + dialect);
75 cfg.SetProperty(Environment.ConnectionDriver, 77 cfg.SetProperty(Environment.ConnectionDriver,
76 "NHibernate.Driver." + parts[1]); 78 "NHibernate.Driver." + parts[1]);
77 cfg.SetProperty(Environment.ConnectionString, parts[2]); 79 cfg.SetProperty(Environment.ConnectionString, parts[2]);
78 cfg.AddAssembly("OpenSim.Data.NHibernate"); 80 cfg.AddAssembly("OpenSim.Data.NHibernate");
79 81
82
83
80 HbmSerializer.Default.Validate = true; 84 HbmSerializer.Default.Validate = true;
81 using (MemoryStream stream = 85 using (MemoryStream stream =
82 HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly())) 86 HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
@@ -84,13 +88,12 @@ namespace OpenSim.Data.NHibernate
84 88
85 factory = cfg.BuildSessionFactory(); 89 factory = cfg.BuildSessionFactory();
86 90
87 // If uncommented this will auto create tables, but it 91
88 // does drops of the old tables, so we need a smarter way 92 // This actually does the roll forward assembly stuff
89 // to acturally manage this. 93 Assembly assem = GetType().Assembly;
90 94 Migration m = new Migration((System.Data.Common.DbConnection)factory.ConnectionProvider.GetConnection(), assem, dialect, "AssetStore");
91 // new SchemaExport(cfg).Create(true, true); 95 m.Update();
92 96
93 InitDB();
94 } 97 }
95 98
96 private void InitDB() 99 private void InitDB()