mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
db/users: add admin column
This commit is contained in:
parent
c8a5da086e
commit
f7d74c97ca
2 changed files with 13 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue