Skip to content

Commit

Permalink
Fixing migration from old databases, will now mark the proper version…
Browse files Browse the repository at this point in the history
… schema
  • Loading branch information
ayende committed Nov 3, 2010
1 parent 8b01311 commit e10d13b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Raven.Storage.Esent/SchemaUpdates/From30To32.cs
@@ -1,4 +1,5 @@
using System;
using System.Text;
using Microsoft.Isam.Esent.Interop;
using Raven.Database.Extensions;
using Raven.Database.Impl;
Expand Down Expand Up @@ -58,7 +59,20 @@ public void Update(Session session, JET_DBID dbid)
tx = new Transaction(session);
}
}
tx.Commit(CommitTransactionGrbit.LazyFlush);

using (var details = new Table(session, dbid, "details", OpenTableGrbit.None))
{
Api.JetMove(session, details, JET_Move.First, MoveGrbit.None);
var columnids = Api.GetColumnDictionary(session, details);

using (var update = new Update(session, details, JET_prep.Replace))
{
Api.SetColumn(session, details, columnids["schema_version"], "3.2", Encoding.Unicode);

update.Save();
}
}
tx.Commit(CommitTransactionGrbit.None);
tx.Dispose();
}
}
Expand Down

0 comments on commit e10d13b

Please sign in to comment.