db/users: add `admin` column
This commit is contained in:
parent
c8a5da086e
commit
f7d74c97ca
|
@ -39,6 +39,7 @@ interface UserRow {
|
|||
pubkey: string;
|
||||
username: string;
|
||||
inserted_at: Date;
|
||||
admin: boolean;
|
||||
}
|
||||
|
||||
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