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:
parent
54c03f1a90
commit
9991f02596
1 changed files with 26 additions and 0 deletions
26
packages/schemas/alterations/next-1668170095-hooks.ts
Normal file
26
packages/schemas/alterations/next-1668170095-hooks.ts
Normal 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;
|
Loading…
Add table
Reference in a new issue