Skip to content

Commit

Permalink
Merge pull request #1204 from brontolosone/1201_index-on-session-table
Browse files Browse the repository at this point in the history
add index on sessions(token); fixes #1201
  • Loading branch information
brontolosone authored Oct 1, 2024
2 parents e339c97 + b83af13 commit 8949164
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/model/migrations/20241001-01-index-on-session-table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2024 ODK Central Developers
// See the NOTICE file at the top-level directory of this distribution and at
// https://github.com/getodk/central-backend/blob/master/NOTICE.
// This file is part of ODK Central. It is subject to the license terms in
// the LICENSE file found in the top-level directory of this distribution and at
// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central,
// including this file, may be copied, modified, propagated, or distributed
// except according to the terms contained in the LICENSE file.

const up = (db) => db.raw(`
CREATE UNIQUE INDEX "sessions_token_index" ON sessions (token);
`);

const down = (db) => db.raw(`
DROP INDEX "sessions_token_index";
`);

module.exports = { up, down };

0 comments on commit 8949164

Please sign in to comment.