Don't forget deleted_images, again. Grmf.
authorSteinar H. Gunderson <sesse@debian.org>
Tue, 21 Aug 2007 05:16:56 +0000 (07:16 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Tue, 21 Aug 2007 05:16:56 +0000 (07:16 +0200)
sql/pr0n.sql
sql/upgrade-v2.50.sql

index d6af63681a720d734254f157860489706fd3b68d..318e9da0463fc271494887dcd8189652e5fb0587 100644 (file)
@@ -46,7 +46,9 @@ CREATE TABLE deleted_images (
     uploadedby character varying,
     "date" timestamp without time zone,
     takenby character varying NOT NULL,
-    selected boolean
+    selected boolean,
+    model character varying,
+    lens character varying
 );
 
 CREATE TABLE fake_files (
index 99cc11d1d529168a7dd7f80a2829824497a01622..035f93436308e06ab8206742df3a49f66bdffdaa 100644 (file)
@@ -46,3 +46,16 @@ UPDATE images SET lens=COALESCE(
     SELECT value FROM exif_info WHERE key='Model' AND images.id=exif_info.image
 ));
 
+ALTER TABLE deleted_images ADD COLUMN model varchar;
+ALTER TABLE deleted_images ADD COLUMN lens varchar;
+UPDATE deleted_images SET lens=COALESCE(
+    TRIM((
+        SELECT value FROM exif_info WHERE key='Lens' AND deleted_images.id=exif_info.image
+    )),
+    TRIM((
+        SELECT value FROM exif_info WHERE key='LensSpec' AND deleted_images.id=exif_info.image
+    ))
+), model=TRIM((
+    SELECT value FROM exif_info WHERE key='Model' AND deleted_images.id=exif_info.image
+));
+