2024-03-16 19:04:55 +08:00
|
|
|
import { sql } from '@silverhand/slonik';
|
2022-10-07 19:48:17 +08:00
|
|
|
|
2022-12-20 13:33:53 +08:00
|
|
|
import type { AlterationScript } from '../lib/types/alteration.js';
|
2022-10-07 19:48:17 +08:00
|
|
|
|
|
|
|
const alteration: AlterationScript = {
|
|
|
|
up: async (pool) => {
|
|
|
|
await pool.query(sql`
|
|
|
|
create table _logto_configs (
|
|
|
|
key varchar(256) not null,
|
2023-04-24 11:11:27 +08:00
|
|
|
value jsonb /* @use JsonObject */ not null default '{}'::jsonb,
|
2022-10-07 19:48:17 +08:00
|
|
|
primary key (key)
|
|
|
|
);
|
|
|
|
`);
|
|
|
|
},
|
|
|
|
down: async (pool) => {
|
|
|
|
await pool.query(sql`drop table _logto_configs;`);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export default alteration;
|