Skip to content

Commit

Permalink
fix AddAttepmtIndexColumn2 migration script for H2
Browse files Browse the repository at this point in the history
  • Loading branch information
frsyuki committed Mar 15, 2017
1 parent 4de18bc commit 70a850a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void migrate(Handle handle, MigrationContext context)
else {
List<IdAndSessionId> list =
handle.createQuery("select id, session_id from session_attempts order by session_id, id")
.map((index, r, ctx) -> new IdAndSessionId(r.getLong("id"), r.getLong("sessionId")))
.map((index, r, ctx) -> new IdAndSessionId(r.getLong("id"), r.getLong("session_id")))
.list();
long lastSessionId = 0L;
long lastIndex = 0;
Expand All @@ -30,7 +30,7 @@ public void migrate(Handle handle, MigrationContext context)
lastIndex = 0;
}
lastIndex++;
handle.createStatement("update session_attempts where id = :id set index = :index")
handle.createStatement("update session_attempts set index = :index where id = :id")
.bind("id", s.id)
.bind("index", lastIndex)
.execute();
Expand Down

0 comments on commit 70a850a

Please sign in to comment.