Mercurial > defr > drupal > filearchiver
comparison filearchiver.install @ 0:ddfec30e1789 tip
Import public
| author | Franck Deroche <webmaster@defr.org> |
|---|---|
| date | Mon, 01 Sep 2008 19:27:32 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:ddfec30e1789 |
|---|---|
| 1 <?php | |
| 2 // $Id$ | |
| 3 | |
| 4 /** | |
| 5 * @file | |
| 6 * File Archiver install file | |
| 7 * | |
| 8 * This file allows the creation of the tables needed by File Archiver. | |
| 9 */ | |
| 10 function filearchiver_install() { | |
| 11 switch ($GLOBALS['db_type']) { | |
| 12 case 'mysql': | |
| 13 case 'mysqli': | |
| 14 db_query("CREATE TABLE {filearchiver_files}( | |
| 15 fid int not null default '0', | |
| 16 source int not null default '1', | |
| 17 archive varchar(250), | |
| 18 PRIMARY KEY(fid, source) | |
| 19 );"); | |
| 20 break; | |
| 21 case 'pgsql': | |
| 22 db_query("CREATE TABLE {filearchiver_files}( | |
| 23 fid int not null default '0', | |
| 24 source int not null default '1', | |
| 25 archive varchar(50), | |
| 26 PRIMARY KEY(fid, source) | |
| 27 "); | |
| 28 break; | |
| 29 } | |
| 30 } | |
| 31 | |
| 32 function filearchiver_uninstall() { | |
| 33 db_query('DROP TABLE {filearchiver_files}'); | |
| 34 variable_del('filearchiver_sources'); | |
| 35 } |
