mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-14 19:04:26 +01:00
db/users: add admin column
This commit is contained in:
@@ -39,6 +39,7 @@ interface UserRow {
|
||||
pubkey: string;
|
||||
username: string;
|
||||
inserted_at: Date;
|
||||
admin: boolean;
|
||||
}
|
||||
|
||||
interface RelayRow {
|
||||
|
||||
12
src/db/migrations/003_events_admin.ts
Normal file
12
src/db/migrations/003_events_admin.ts
Normal file
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user