Mercurial > defr > drupal > filearchiver
diff filearchiver.install @ 0:ddfec30e1789 tip
Import public
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Mon, 01 Sep 2008 19:27:32 +0200 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filearchiver.install Mon Sep 01 19:27:32 2008 +0200 @@ -0,0 +1,35 @@ +<?php +// $Id$ + +/** + * @file + * File Archiver install file + * + * This file allows the creation of the tables needed by File Archiver. + */ +function filearchiver_install() { + switch ($GLOBALS['db_type']) { + case 'mysql': + case 'mysqli': + db_query("CREATE TABLE {filearchiver_files}( + fid int not null default '0', + source int not null default '1', + archive varchar(250), + PRIMARY KEY(fid, source) + );"); + break; + case 'pgsql': + db_query("CREATE TABLE {filearchiver_files}( + fid int not null default '0', + source int not null default '1', + archive varchar(50), + PRIMARY KEY(fid, source) + "); + break; + } +} + +function filearchiver_uninstall() { + db_query('DROP TABLE {filearchiver_files}'); + variable_del('filearchiver_sources'); +}