diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-26 23:38:17 +0000 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-26 23:38:17 +0000 |
| commit | d097b4fc027ff558bf5f580298c7bed3696dcd3d (patch) | |
| tree | af67745f12cdb7ebeeff9b615fbf8ec3f5cd6881 /modules/image_block/helpers/image_block_installer.php | |
| parent | 960c4248deb43eb824dda14670ea1f759a709013 (diff) | |
Update to image_block based on bharat's feedback
1) move the rand_key column into core
2) don't do a max rand, just try to a get a random number less than
the current random number if that doesn't successd look the other way
Diffstat (limited to 'modules/image_block/helpers/image_block_installer.php')
| -rw-r--r-- | modules/image_block/helpers/image_block_installer.php | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/modules/image_block/helpers/image_block_installer.php b/modules/image_block/helpers/image_block_installer.php index 6b0ec20b..386ad2f5 100644 --- a/modules/image_block/helpers/image_block_installer.php +++ b/modules/image_block/helpers/image_block_installer.php @@ -24,18 +24,12 @@ class image_block_installer { if ($version == 0) { $db = Database::instance(); - $db->query("ALTER TABLE `items` ADD `rand_key` FLOAT DEFAULT NULL"); - $db->query("UPDATE `items` SET `rand_key` = RAND()"); - $db->query("CREATE INDEX `random_index` ON `items` (rand_key DESC)"); - module::set_version("image_block", 1); } } static function uninstall() { $db = Database::instance(); - // Dropping the column should drop the index as well. - $db->query("ALTER TABLE `items` DROP `rand_key`"); module::delete("image_block"); } |
