mirror of
https://github.com/aljazceru/ditto.git
synced 2026-02-08 23:14:19 +01:00
Store the Push Subscription in the database
This commit is contained in:
@@ -59,6 +59,7 @@ interface EventZapRow {
|
||||
interface PushSubscriptionRow {
|
||||
id: Generated<bigint>;
|
||||
pubkey: string;
|
||||
token_hash: Uint8Array;
|
||||
endpoint: string;
|
||||
p256dh: string;
|
||||
auth: string;
|
||||
|
||||
@@ -5,7 +5,7 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||
.createTable('push_subscriptions')
|
||||
.addColumn('id', 'bigint', (c) => c.primaryKey().autoIncrement())
|
||||
.addColumn('pubkey', 'char(64)', (c) => c.notNull())
|
||||
.addColumn('token', 'char(64)', (c) => c.notNull())
|
||||
.addColumn('token_hash', 'bytea', (c) => c.references('auth_tokens.token_hash').onDelete('cascade').notNull())
|
||||
.addColumn('endpoint', 'text', (c) => c.notNull())
|
||||
.addColumn('p256dh', 'text', (c) => c.notNull())
|
||||
.addColumn('auth', 'text', (c) => c.notNull())
|
||||
|
||||
Reference in New Issue
Block a user