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