db/users: add `admin` column
This commit is contained in:
parent
c8a5da086e
commit
f7d74c97ca
|
@ -39,6 +39,7 @@ interface UserRow {
|
||||||
pubkey: string;
|
pubkey: string;
|
||||||
username: string;
|
username: string;
|
||||||
inserted_at: Date;
|
inserted_at: Date;
|
||||||
|
admin: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RelayRow {
|
interface RelayRow {
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { Kysely } from '@/deps.ts';
|
||||||
|
|
||||||
|
export async function up(db: Kysely<any>): Promise<void> {
|
||||||
|
await db.schema
|
||||||
|
.alterTable('users')
|
||||||
|
.addColumn('admin', 'boolean', (col) => col.defaultTo(false))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function down(db: Kysely<any>): Promise<void> {
|
||||||
|
await db.schema.dropTable('relays').execute();
|
||||||
|
}
|
Loading…
Reference in New Issue