From cf44a3adbb125a93563fa5e7e352acc49e70b299 Mon Sep 17 00:00:00 2001 From: Luan Date: Fri, 25 Oct 2013 15:20:45 -0200 Subject: [PATCH] adding size field to attachment view --- src/proxy/migrations/0003_create_attachment_view.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/proxy/migrations/0003_create_attachment_view.py b/src/proxy/migrations/0003_create_attachment_view.py index 46df6f8..bdb8ea8 100644 --- a/src/proxy/migrations/0003_create_attachment_view.py +++ b/src/proxy/migrations/0003_create_attachment_view.py @@ -16,10 +16,11 @@ class Migration(DataMigration): CREATE OR REPLACE VIEW attachment_view AS SELECT CONCAT(attachment.type, '/' , attachment.id, '/', attachment.filename) AS url, attachment.type AS used_by, - attachment.filename as filename, + attachment.filename AS filename, (SELECT LOWER(SUBSTRING(attachment.filename FROM '\w{2,3}$'))) AS mimetype, - attachment.author as author, - attachment.description as description, + attachment.author AS author, + attachment.description AS description, + attachment.size AS size, TIMESTAMP WITH TIME ZONE 'epoch' + (attachment.time/1000000)* INTERVAL '1s' AS created FROM attachment; ''') -- libgit2 0.21.2