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:
parent
7bf52aa7ad
commit
93cd6a27d0
2 changed files with 19 additions and 0 deletions
|
@ -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;
|
|
@ -20,3 +20,4 @@ create table users (
|
|||
);
|
||||
|
||||
create index users__created_at on users (created_at);
|
||||
create index users__name on users (name);
|
||||
|
|
Loading…
Add table
Reference in a new issue