file_aliases.install in File Aliases 5
File
file_aliases.install
View source
<?php
function file_aliases_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("ALTER TABLE {filefield_paths} ADD COLUMN filealias mediumtext NOT NULL");
break;
case 'pgsql':
db_add_column($ret = array(), 'filefield_paths', 'filealias', 'text', array(
'not null' => TRUE,
'default' => '',
));
break;
}
}
function file_aliases_uninstall() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
case 'pgsql':
db_query("ALTER TABLE {filefield_paths} DROP filealias");
db_query("DELETE FROM {url_alias} WHERE src LIKE '%s'", 'filefield_paths/alias/%');
break;
}
}