Drop PDS event queue tables ()

* take notifs off of message queue

* fix order of notif handling

* rip out message queue

* drop mq tables

* rm stream consumers

* Tidy

* Temporarily remove drop message queue migration

* Revert "Temporarily remove drop message queue migration"

This reverts commit 95c02e128a650469543f5b14418c4ff32c088d20.

---------

Co-authored-by: dholms <dtholmgren@gmail.com>
This commit is contained in:
devin ivy 2023-04-11 21:56:01 -07:00 committed by GitHub
parent 95ac1808ac
commit 153542ae81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

@ -0,0 +1,32 @@
import { Kysely } from 'kysely'
import { Dialect } from '..'
const messageQueueTable = 'message_queue'
const messageQueueCursorTable = 'message_queue_cursor'
export async function up(db: Kysely<unknown>): Promise<void> {
await db.schema.dropTable(messageQueueCursorTable).execute()
await db.schema.dropTable(messageQueueTable).execute()
}
export async function down(
db: Kysely<unknown>,
dialect: Dialect,
): Promise<void> {
let mqBuilder = db.schema.createTable(messageQueueTable)
mqBuilder =
dialect === 'pg'
? mqBuilder.addColumn('id', 'serial', (col) => col.primaryKey())
: mqBuilder.addColumn('id', 'integer', (col) =>
col.autoIncrement().primaryKey(),
)
mqBuilder
.addColumn('message', 'varchar', (col) => col.notNull())
.addColumn('createdAt', 'varchar', (col) => col.notNull())
.execute()
await db.schema
.createTable(messageQueueCursorTable)
.addColumn('consumer', 'varchar', (col) => col.primaryKey())
.addColumn('cursor', 'integer', (col) => col.notNull())
.execute()
}

@ -36,3 +36,4 @@ export * as _20230328T214311003Z from './20230328T214311003Z-backlinks'
export * as _20230328T214311004Z from './20230328T214311004Z-profile-display-name-empty'
export * as _20230328T214311005Z from './20230328T214311005Z-rework-seq'
export * as _20230406T185855842Z from './20230406T185855842Z-feed-item-init'
export * as _20230411T175730759Z from './20230411T175730759Z-drop-message-queue'