0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/packages/schemas/alterations/1.15.0-1710408335-make-resource-scopes-description-nullable.ts
2024-04-10 21:27:24 +08:00

22 lines
559 B
TypeScript

import { sql } from '@silverhand/slonik';
import type { AlterationScript } from '../lib/types/alteration.js';
const alteration: AlterationScript = {
up: async (pool) => {
// Make the resource scopes description nullable
await pool.query(sql`
alter table scopes
alter column description drop not null;
`);
},
down: async (pool) => {
// Revert the resource scopes description nullable
await pool.query(sql`
alter table scopes
alter column description set not null;
`);
},
};
export default alteration;