Permalink
Browse files

Fixing migration from old databases, will now mark the proper version…

… schema
  • Loading branch information...
ayende committed Nov 3, 2010
1 parent 8b01311 commit e10d13be3d6cc0a562a845697a8e4935569ee1d0
Showing with 15 additions and 1 deletion.
  1. +15 −1 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;
@@ -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();
}
}

0 comments on commit e10d13b

Please sign in to comment.