You are here

function brilliant_gallery_update_1 in Brilliant Gallery 5.4

Same name and namespace in other branches
  1. 5.3 brilliant_gallery.install \brilliant_gallery_update_1()

File

./brilliant_gallery.install, line 39

Code

function brilliant_gallery_update_1() {
  $items = array();
  drupal_set_message(t('Creating tables for brilliant gallery checklists'));
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      update_sql("CREATE TABLE brilliant_gallery_checklist (\n     nid int NOT NULL default 0,\n            user int NOT NULL default 0,\n     qid text NOT NULL,\n     state int NOT NULL default 0,\n     PRIMARY KEY (nid, user, qid(255))\n     );");
      $sucess = TRUE;
      break;
    case 'pgsql':
      update_sql("CREATE TABLE brilliant_gallery_checklist (\n     nid int NOT NULL default 0,\n            user int NOT NULL default 0,\n     qid text NOT NULL,\n     state int NOT NULL default 0,\n     PRIMARY KEY (nid, user, qid)\n     );\n          ");
      $sucess = TRUE;
      break;
    default:
      drupal_set_message(t("Error: Unsupported database"));
  }
  if ($success) {
    drupal_set_message(t("Tables created successfully"));
  }
  return $items;
}