diff options
Diffstat (limited to 'migrations/2018-04-14-145711_create_index_view/up.sql')
-rw-r--r-- | migrations/2018-04-14-145711_create_index_view/up.sql | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/migrations/2018-04-14-145711_create_index_view/up.sql b/migrations/2018-04-14-145711_create_index_view/up.sql deleted file mode 100644 index 3b7ddc1d647a..000000000000 --- a/migrations/2018-04-14-145711_create_index_view/up.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Create a simple view that returns the list of threads ordered by --- the last post that occured in the thread. - -CREATE VIEW thread_index AS - SELECT t.id AS thread_id, - t.title AS title, - t.author_name AS author_name, - t.posted AS posted, - p.id AS post_id - FROM threads t - JOIN (SELECT DISTINCT ON (thread_id) id, thread_id - FROM posts - ORDER BY thread_id, id DESC) AS p - ON t.id = p.thread_id - ORDER BY p.id DESC; |