0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

feat(schemas): add isSuspended columns (#4323)

add isSuspended columns
This commit is contained in:
simeng-li 2023-08-14 15:15:12 +08:00 committed by GitHub
parent ae0ef919fb
commit 2eaa42e588
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
import { sql } from 'slonik';
import type { AlterationScript } from '../lib/types/alteration.js';
const alteration: AlterationScript = {
up: async (pool) => {
await pool.query(sql`
alter table tenants add column is_suspended boolean not null default false;
`);
},
down: async (pool) => {
await pool.query(sql`
alter table tenants drop column is_suspended;
`);
},
};
export default alteration;

View file

@ -18,6 +18,7 @@ export const Tenants = createModel(
name varchar(128) not null default 'My Project',
tag varchar(64) not null default '${TenantTag.Development}',
created_at timestamptz not null default(now()),
is_suspended boolean not null default false,
primary key (id),
constraint tenants__db_user
unique (db_user)