mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
parent
ae0ef919fb
commit
2eaa42e588
2 changed files with 19 additions and 0 deletions
|
@ -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;
|
|
@ -18,6 +18,7 @@ export const Tenants = createModel(
|
||||||
name varchar(128) not null default 'My Project',
|
name varchar(128) not null default 'My Project',
|
||||||
tag varchar(64) not null default '${TenantTag.Development}',
|
tag varchar(64) not null default '${TenantTag.Development}',
|
||||||
created_at timestamptz not null default(now()),
|
created_at timestamptz not null default(now()),
|
||||||
|
is_suspended boolean not null default false,
|
||||||
primary key (id),
|
primary key (id),
|
||||||
constraint tenants__db_user
|
constraint tenants__db_user
|
||||||
unique (db_user)
|
unique (db_user)
|
||||||
|
|
Loading…
Reference in a new issue