summaryrefslogtreecommitdiff
path: root/modules/server_add/helpers/server_add_installer.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-11 05:03:36 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-11 05:03:36 -0700
commit954ab5a5051edb67eca8ae74283a80a226e39672 (patch)
treee27757f7ea82d064d2cd9a38b295648b4073f850 /modules/server_add/helpers/server_add_installer.php
parent8e8a9f728b4e04f281eacc1467e79f55cb2343c5 (diff)
Further simplify server_add (and bump it to version 3).
Now we don't have checkboxes, but instead we restrict you to selecting directories and albums from only one level in the hierarchy. This makes it easier for us to make sure that we properly create the hierarchy that you want and avoid confusion about what's going to wind up where. Modify Server_Add_File_Model to have a parent_id and item_id and then modify them as we go so that we can build up a tree structure there *before* we create any items. This makes it much easier to figure out where a new item is going to go and get rid of a bunch of probably buggy code in the main task.
Diffstat (limited to 'modules/server_add/helpers/server_add_installer.php')
-rw-r--r--modules/server_add/helpers/server_add_installer.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/server_add/helpers/server_add_installer.php b/modules/server_add/helpers/server_add_installer.php
index 6956a72c..4cc34207 100644
--- a/modules/server_add/helpers/server_add_installer.php
+++ b/modules/server_add/helpers/server_add_installer.php
@@ -22,8 +22,10 @@ class server_add_installer {
$db = Database::instance();
$db->query("CREATE TABLE {server_add_files} (
`id` int(9) NOT NULL auto_increment,
- `task_id` int(9) NOT NULL,
`file` varchar(255) NOT NULL,
+ `item_id` int(9),
+ `parent_id` int(9),
+ `task_id` int(9) NOT NULL,
PRIMARY KEY (`id`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
module::set_version("server_add", 2);
@@ -40,6 +42,10 @@ class server_add_installer {
PRIMARY KEY (`id`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
module::set_version("server_add", $version = 2);
+ } else if ($version == 2) {
+ $db->query("ALTER TABLE {server_add_files} ADD COLUMN `item_id` int(9)");
+ $db->query("ALTER TABLE {server_add_files} ADD COLUMN `parent_id` int(9)");
+ module::set_version("server_add", $version = 3);
}
}