summaryrefslogtreecommitdiff
path: root/modules/exif/helpers/exif_installer.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-11 03:53:44 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-11 03:53:44 +0000
commit977d0da9f3bac811793bffa7cf6b605599c9f871 (patch)
tree9dc028c3c0305d9747e12f655c45b4e2f985e67d /modules/exif/helpers/exif_installer.php
parentb706cb69ac7737a550c8f7fff025a6abeb3cfcb6 (diff)
Refactor the exif module to denormalize the stored data. This way we
have a single exif_record for each item instead of 1 per key. It's about 5x faster to scan photos this way.
Diffstat (limited to 'modules/exif/helpers/exif_installer.php')
-rw-r--r--modules/exif/helpers/exif_installer.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/exif/helpers/exif_installer.php b/modules/exif/helpers/exif_installer.php
index 4cd1a6b2..b68af794 100644
--- a/modules/exif/helpers/exif_installer.php
+++ b/modules/exif/helpers/exif_installer.php
@@ -23,16 +23,11 @@ class exif_installer {
if ($version == 0) {
$db = Database::instance();
- $db->query("CREATE TABLE IF NOT EXISTS {exif_keys} (
- `id` int(9) NOT NULL auto_increment,
- `item_id` int(9) NOT NULL,
- `name` varchar(64) NOT NULL,
- `value` varchar(1536) NOT NULL,
- PRIMARY KEY (`id`))
- ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$db->query("CREATE TABLE IF NOT EXISTS {exif_records} (
`id` int(9) NOT NULL auto_increment,
- `item_id` int(9) NOT NULL,
+ `item_id` INTEGER(9) NOT NULL,
+ `key_count` INTEGER(9) default 0,
+ `data` TEXT,
`dirty` BOOLEAN default 1,
PRIMARY KEY (`id`),
KEY(`item_id`))
@@ -43,7 +38,6 @@ class exif_installer {
static function uninstall() {
$db = Database::instance();
- $db->query("DROP TABLE IF EXISTS {exif_keys};");
$db->query("DROP TABLE IF EXISTS {exif_records};");
module::delete("exif");
}