diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2010-01-01 17:41:20 -0800 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-01 17:41:20 -0800 |
| commit | 6d5d68a3f963109230b898bc1b559af7ac7585f7 (patch) | |
| tree | 3b62add893080e9504ff4af0767d81ea16d4c7f0 /modules/g2_import/helpers/g2_import_installer.php | |
| parent | df001700dd071c59c47afd07d2c756487d20684e (diff) | |
Start tracking the original G2 url and id for all entities. This will
allow us to map G2 image urls to the appropriate G3 ones.
Diffstat (limited to 'modules/g2_import/helpers/g2_import_installer.php')
| -rw-r--r-- | modules/g2_import/helpers/g2_import_installer.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/g2_import/helpers/g2_import_installer.php b/modules/g2_import/helpers/g2_import_installer.php index feacb518..77b61d3e 100644 --- a/modules/g2_import/helpers/g2_import_installer.php +++ b/modules/g2_import/helpers/g2_import_installer.php @@ -24,14 +24,27 @@ class g2_import_installer { `id` int(9) NOT NULL auto_increment, `g2_id` int(9) NOT NULL, `g3_id` int(9) NOT NULL, + `g2_url` varchar(255) default NULL, + `resource_type` varchar(64) default NULL, PRIMARY KEY (`id`), - KEY (`g2_id`)) + KEY `g2_url` (`g2_url`), + KEY `g2_id` (`g2_id`)) DEFAULT CHARSET=utf8;"); module::set_version("g2_import", 1); mkdir(VARPATH . "modules/g2_import"); } + static function upgrade($version) { + $db = Database::instance(); + if ($version == 1) { + $db->query("ALTER TABLE {g2_maps} ADD COLUMN `g2_url` VARCHAR(255)"); + $db->query("ALTER TABLE {g2_maps} ADD COLUMN `resource_type` VARCHAR(64)"); + $db->query("ALTER TABLE {g2_maps} ADD KEY `g2_url` (`g2_url`)"); + module::set_version("g2_import", $version = 2); + } + } + static function uninstall() { @dir::unlink(VARPATH . "modules/g2_import"); } |
