Skip to content

Commit

Permalink
fixup! fixup! Fixes #24456: Missing primary key statement for user se…
Browse files Browse the repository at this point in the history
…ssions table creation when migrating

Fixes #24456: Missing primary key statement for user sessions table creation when migrating
  • Loading branch information
fanf committed Mar 14, 2024
1 parent c0b1f3d commit 3b85ed1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class CheckTableUsers(

// In 7.0.13, we missed the primary key for usersessions
def addPrimaryKey: IOResult[Unit] = {
val sql =
val sql = {
sql"""
DO $$$$ BEGIN
IF NOT EXISTS (select constraint_name from information_schema.table_constraints
Expand All @@ -105,6 +105,7 @@ class CheckTableUsers(
ALTER TABLE usersessions ADD PRIMARY KEY (userId,sessionId);
end if;
END $$$$;"""
}

transactIOResult(s"Error with primary key creation for usersessions")(xa => sql.update.run.transact(xa)).unit
}
Expand Down

0 comments on commit 3b85ed1

Please sign in to comment.