0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-10 21:58:23 -05:00

chore: add hooks alteration scripts

This commit is contained in:
Gao Sun 2022-11-11 20:39:08 +08:00
parent 54c03f1a90
commit 9991f02596
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -0,0 +1,26 @@
import { sql } from 'slonik';
import type { AlterationScript } from '../lib/types/alteration';
const alteration: AlterationScript = {
up: async (pool) => {
await pool.query(sql`
create table hooks (
id varchar(128) not null,
event varchar(128) not null,
config jsonb /* @use HookConfig */ not null,
created_at timestamptz not null default(now()),
primary key (id)
);
create index hooks__event on hooks (event);
`);
},
down: async (pool) => {
await pool.query(sql`
drop table hooks;
`);
},
};
export default alteration;