fix nhibernate driver so that it starts (based on the appearance

changes it wouldn't come up).
include embedded dialect specific sql files for nhibernate migrations
figure out how to get the raw db connection so that migrations can
work with nhibernate.
create initial migration for NHibernate + SQLite + Assets.
0.6.0-stable
Sean Dague 2008-06-16 19:22:00 +00:00
parent caa6b8467d
commit 340ef33e2e
4 changed files with 8 additions and 4 deletions

View File

@ -227,10 +227,11 @@ namespace OpenSim.Data
foreach (string s in names) foreach (string s in names)
{ {
m_log.InfoFormat("[MIGRATION] - testing resoure {0}", s);
Match m = _match.Match(s); Match m = _match.Match(s);
if (m.Success) if (m.Success)
{ {
// m_log.Info("MIGRATION: Match: " + m.Groups[1].ToString()); m_log.Info("MIGRATION: Match: " + m.Groups[1].ToString());
int version = int.Parse(m.Groups[1].ToString()); int version = int.Parse(m.Groups[1].ToString());
if (version > after) { if (version > after) {
using (Stream resource = _assem.GetManifestResourceStream(s)) using (Stream resource = _assem.GetManifestResourceStream(s))

View File

@ -8,7 +8,7 @@ create table Assets(
Description varchar(64), Description varchar(64),
Local boolean, Local boolean,
Temporary boolean, Temporary boolean,
Data blob, Data blob
); );
END; END;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="OpenSim.Framework.UserAppearance, OpenSim.Framework" table="UserAppearances" lazy="false"> <class name="OpenSim.Framework.AvatarAppearance, OpenSim.Framework" table="UserAppearances" lazy="false">
<id name="User" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate"> <id name="Owner" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate">
<generator class="assigned" /> <generator class="assigned" />
</id> </id>
<property name="BodyItem" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate" /> <property name="BodyItem" type="OpenSim.Data.NHibernate.LLUUIDUserType, OpenSim.Data.NHibernate" />

View File

@ -1339,6 +1339,9 @@
<Files> <Files>
<Match pattern="*.cs" recurse="true"/> <Match pattern="*.cs" recurse="true"/>
<Match path="Resources" pattern="*.xml" buildAction="EmbeddedResource"/> <Match path="Resources" pattern="*.xml" buildAction="EmbeddedResource"/>
<!-- add more as you go -->
<Match path="Resources/SQLiteDialect" pattern="*.sql" buildAction="EmbeddedResource"/>
<Match path="Resources/MySQLDialect" pattern="*.sql" buildAction="EmbeddedResource"/>
</Files> </Files>
</Project> </Project>