aboutsummaryrefslogtreecommitdiff
path: root/src/guff.cr
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-05-25 01:19:52 -0400
committerPaul Duncan <pabs@pablotron.org>2016-05-25 01:19:52 -0400
commit9679aa0d8f072a06f7c8af3b92c87fc3f23a804c (patch)
treeede1c412c6374b051987ff38b104767e641fc787 /src/guff.cr
parentc5da1e620c07697c2b7b5d4b51db73ef0fc143e4 (diff)
downloadguff-9679aa0d8f072a06f7c8af3b92c87fc3f23a804c.tar.bz2
guff-9679aa0d8f072a06f7c8af3b92c87fc3f23a804c.zip
populate posts table
Diffstat (limited to 'src/guff.cr')
-rw-r--r--src/guff.cr20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/guff.cr b/src/guff.cr
index d3817d0..dc04fbe 100644
--- a/src/guff.cr
+++ b/src/guff.cr
@@ -276,6 +276,8 @@ module Guff
ON (b.state_id = a.state_id)
JOIN sites c
ON (c.site_id = a.site_id)
+ JOIN users d
+ ON (d.user_id = a.created_by)
LEFT JOIN blogs x
ON (x.post_id = a.post_id)
LEFT JOIN pages y
@@ -291,8 +293,22 @@ module Guff
a.site_id,
c.name AS site_name,
b.state,
+ d.user_id,
+ d.name AS user_name,
+ d.email AS user_email,
+
+ a.created_at,
+ date(a.created_at) AS created_at_text,
+ datetime(a.created_at) AS created_at_text_full,
+
a.posted_at,
+ date(a.posted_at) AS posted_at_text,
+ datetime(a.posted_at) AS posted_at_text_full,
+
a.expires_at,
+ date(a.expires_at) AS expires_at_text,
+ datetime(a.expires_at) AS expires_at_text_full,
+
a.slug,
a.slug_lock,
a.name,
@@ -310,7 +326,7 @@ module Guff
strftime('/%%Y/%%m/%%d/', a.posted_at) || a.slug || '.html'
WHEN y.post_id IS NOT NULL THEN
'/' || a.slug || '.html'
- WHEN x.post_id IS NOT NULL THEN
+ WHEN z.post_id IS NOT NULL THEN
'/' || a.slug || '/'
END
ELSE
@@ -322,6 +338,8 @@ module Guff
ON (b.state_id = a.state_id)
JOIN sites c
ON (c.site_id = a.site_id)
+ JOIN users d
+ ON (d.user_id = a.created_by)
LEFT JOIN blogs x
ON (x.post_id = a.post_id)