[mirrorbrain-commits] r8006 - /trunk/sql/schema-postgresql.sql

From: <poeml_at_mirrorbrain.org>
Date: Tue, 16 Mar 2010 15:58:39 -0000
Author: poeml
Date: Tue Mar 16 16:58:38 2010
New Revision: 8006

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8006&view=rev
Log:
SQL schema: in addition to the hex-encoded columns in the hexhash view, provide
the original binary columns

Modified:
    trunk/sql/schema-postgresql.sql

Modified: trunk/sql/schema-postgresql.sql
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/sql/schema-postgresql.sql?rev=8006&r1=8005&r2=8006&view=diff
==============================================================================
--- trunk/sql/schema-postgresql.sql (original)
+++ trunk/sql/schema-postgresql.sql Tue Mar 16 16:58:38 2010
@@ -34,13 +34,19 @@
         "pgp" TEXT NOT NULL
 );
 
+-- For conveniency, this view provides the binary columns from the "hash" table
+-- also encoded in hex
 CREATE VIEW hexhash AS 
   SELECT file_id, mtime, size, 
-         encode(md5, 'hex') AS md5, 
-         encode(sha1, 'hex') AS sha1, 
-         encode(sha256, 'hex') AS sha256, 
+         md5,
+         encode(md5, 'hex') AS md5hex, 
+         sha1,
+         encode(sha1, 'hex') AS sha1hex, 
+         sha256,
+         encode(sha256, 'hex') AS sha256hex, 
          sha1piecesize, 
-         encode(sha1pieces, 'hex') AS sha1pieces,
+         sha1pieces,
+         encode(sha1pieces, 'hex') AS sha1pieceshex,
          pgp 
   FROM hash;
 




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Mar 16 2010 - 15:58:40 GMT

This archive was generated by hypermail 2.2.0 : Tue Mar 16 2010 - 16:17:06 GMT