0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-24 22:41:28 -05:00

refactor(schemas): add name index on users (#2668)

This commit is contained in:
Gao Sun 2022-12-15 10:50:48 +08:00 committed by GitHub
parent 7bf52aa7ad
commit 93cd6a27d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
import { sql } from 'slonik';
import type { AlterationScript } from '../lib/types/alteration.js';
const alteration: AlterationScript = {
up: async (pool) => {
await pool.query(sql`
create index users__name on users (name);
`);
},
down: async (pool) => {
await pool.query(sql`
drop index users__name;
`);
},
};
export default alteration;

View file

@ -20,3 +20,4 @@ create table users (
);
create index users__created_at on users (created_at);
create index users__name on users (name);