0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-10 22:22:45 -05:00
logto/packages/schemas/alterations/next-1741318144-add-one-time-token-unique-index.ts
Darcy Ye 7a2014c4a7
feat: add POST /one-time-tokens/verify API (#7098)
* feat: add POST /one-time-tokens/verify API

* chore: fix integration tests

* chore: update code
2025-03-10 11:48:28 +08:00

18 lines
447 B
TypeScript

import { sql } from '@silverhand/slonik';
import type { AlterationScript } from '../lib/types/alteration.js';
const alteration: AlterationScript = {
up: async (pool) => {
await pool.query(sql`
create unique index one_time_token__token on one_time_tokens (tenant_id, token);
`);
},
down: async (pool) => {
await pool.query(sql`
drop index if exists one_time_token__token;
`);
},
};
export default alteration;