mirror of
https://github.com/logto-io/logto.git
synced 2024-12-23 20:33:16 -05:00
22 lines
571 B
TypeScript
22 lines
571 B
TypeScript
|
import { sql } from 'slonik';
|
||
|
|
||
|
import type { AlterationScript } from '../lib/types/alteration.js';
|
||
|
|
||
|
/** Drop `resources_indicator_key` unique constraint since it's duplicated with the unique index. */
|
||
|
const alteration: AlterationScript = {
|
||
|
up: async (pool) => {
|
||
|
await pool.query(sql`
|
||
|
alter table resources
|
||
|
drop constraint resources_indicator_key;
|
||
|
`);
|
||
|
},
|
||
|
down: async (pool) => {
|
||
|
await pool.query(sql`
|
||
|
alter table resources
|
||
|
add constraint resources_indicator_key unique (indicator);
|
||
|
`);
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export default alteration;
|