@@ -76,17 +76,17 @@ export async function getActivitiesById(
7676}
7777
7878/**
79- * Finds activity timestamp by id, without tenant or segment filters
79+ * Finds activity createdAt by id, without tenant or segment filters
8080 * @param qdbConn
8181 * @param id
8282 * @returns IActivityCreateData
8383 */
84- export async function getActivityTimestampById (
84+ export async function getActivityCreatedAtById (
8585 qdbConn : DbConnOrTx ,
8686 id : string ,
8787) : Promise < Partial < IActivityDbBase > > {
8888 const query = `
89- SELECT timestamp
89+ SELECT "createdAt"
9090 FROM activities
9191 WHERE "deletedAt" IS NULL
9292 and id = $(id)
@@ -1738,21 +1738,22 @@ export async function moveActivityRelationsToAnotherOrganization(
17381738 } while ( rowsUpdated === batchSize )
17391739}
17401740
1741- export async function getActivityRelationsSortedByTimestamp (
1741+ export async function getActivityRelationsSortedByCreatedAt (
17421742 qdbConn : DbConnOrTx ,
1743- cursorActivityTimestamp ?: string ,
1743+ cursorActivityCreatedAt ?: string ,
17441744 limit = 100 ,
17451745) {
17461746 let cursorQuery = ''
17471747
1748- if ( cursorActivityTimestamp ) {
1749- cursorQuery = `AND timestamp >= $(cursorActivityTimestamp )`
1748+ if ( cursorActivityCreatedAt ) {
1749+ cursorQuery = `AND "createdAt" >= $(cursorActivityCreatedAt )`
17501750 }
17511751
17521752 const query = `
17531753 SELECT
17541754 id,
17551755 "memberId",
1756+ "createdAt",
17561757 "objectMemberId",
17571758 "organizationId",
17581759 "conversationId",
@@ -1764,12 +1765,12 @@ export async function getActivityRelationsSortedByTimestamp(
17641765 FROM activities
17651766 WHERE "deletedAt" IS NULL
17661767 ${ cursorQuery }
1767- ORDER BY timestamp asc
1768+ ORDER BY "createdAt" asc
17681769 LIMIT ${ limit }
17691770 `
17701771
17711772 const rows = await qdbConn . any ( query , {
1772- cursorActivityTimestamp ,
1773+ cursorActivityCreatedAt ,
17731774 limit,
17741775 } )
17751776
0 commit comments