SELECT * FROM PostEntity
JOIN ProfileEntity ON PostEntity.authorId = ProfileEntity.profileId
LEFT JOIN PostEntity AS Quote ON PostEntity.quoteId = Quote.postId
LEFT JOIN ProfileEntity AS QuoteProfile ON Quote.authorId = QuoteProfile.profileId
LEFT JOIN PostEntity AS BoostedPost ON PostEntity.boostedPostId = BoostedPost.postId
LEFT JOIN ProfileEntity AS BoostedPostProfile ON BoostedPost.authorId = BoostedPostProfile.profileId
WHERE PostEntity.authorId = :authorId || BoostedPost.authorId = :authorId
ORDER BY PostEntity.createdAt DESC;
Some of your tickets have overlapping time and date. Please resolve to continue checkoutexcuse me? who do you think you are?


fun Post.unwrapPosts(): List<Post> {
val posts = mutableListOf(this)
if (quote != null) posts.addAll(quote.unwrapPosts())
if (boostedPost != null) posts.addAll(boostedPost.unwrapPosts())
return posts
}fun Post.unwrapQuotes(): List<Post> {
val quotes = mutableListOf(this)
var currentQuote = quote
while (currentQuote != null) {
quotes.add(0, currentQuote)
currentQuote = currentQuote.quote
}
return quotes
}