Skip to content

Commit

Permalink
chore: remove old invite notifications (#10345)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
  • Loading branch information
mattkrick authored Oct 15, 2024
1 parent f20d364 commit 6c8d420
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {r} from 'rethinkdb-ts'
import connectRethinkDB from '../../database/connectRethinkDB'

export async function up() {
await connectRethinkDB()
const almostAMonthAgo = new Date(Date.now() - 29 * 24 * 60 * 60 * 1000)
await r
.table('Notification')
.filter({type: 'TEAM_INVITATION'})
.filter((row) => row('createdAt').le(almostAMonthAgo))
.delete()
.run()
}

export async function down() {
// noop
}

0 comments on commit 6c8d420

Please sign in to comment.