You are here

function alinks_update_1 in Alinks 7

Same name and namespace in other branches
  1. 6 alinks.install \alinks_update_1()

File

./alinks.install, line 85
Install, update and uninstall functions for the Alinks module.

Code

function alinks_update_1() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_add_column($ret, 'alinks', 'alink_start_boundary', 'TINYINT(1)', array(
        'DEFAULT' => 0,
      ));
      db_add_column($ret, 'alinks', 'alink_end_boundary', 'TINYINT(1)', array(
        'DEFAULT' => 0,
      ));
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {alinks} ADD COLUMN alink_start_boundary TINYINT(1) NOT NULL DEFAULT 0 AFTER id");
      $ret[] = update_sql("ALTER TABLE {alinks} ADD COLUMN alink_end_boundary TINYINT(1) NOT NULL DEFAULT 0 AFTER alink_text");
      break;
  }
  return $ret;
}