You are here

function file_aliases_install in File Aliases 5

Same name and namespace in other branches
  1. 6 file_aliases.install \file_aliases_install()
  2. 7 file_aliases.install \file_aliases_install()

Implementation of hook_install().

File

./file_aliases.install, line 10

Code

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;
  }
}