You are here

function deploy_update_1 in Deploy - Content Staging 5

File

./deploy.install, line 99

Code

function deploy_update_1() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {deploy_plan} ADD description text");
      $ret[] = update_sql("ALTER TABLE {deploy_plan_items} ADD uid int NOT NULL");
      $ret[] = update_sql("ALTER TABLE {deploy_plan_items} ADD ts int NOT NULL");
      $ret[] = update_sql("CREATE TABLE {deploy_log} (\n        dlid int unsigned NOT NULL,\n        plan varchar(50) NOT NULL,\n        server varchar(100) NOT NULL,\n        username varchar(60) NOT NULL,\n        ts int NOT NULL,\n        PRIMARY KEY (dlid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      $ret[] = update_sql("CREATE TABLE {deploy_log_details} (\n        dldid int unsigned NOT NULL,\n        dlid int unsigned NOT NULL, \n        module varchar(50) NOT NULL,\n        description varchar(75) NOT NULL,\n        result varchar(25) NOT NULL,\n        message varchar(255) NOT NULL,\n        PRIMARY KEY (dldid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_add_column($ret, 'deploy_plan', 'description', 'text');
      db_add_column($ret, 'deploy_plan_items', 'uid', 'int', array(
        'not null' => TRUE,
      ));
      db_add_column($ret, 'deploy_plan_items', 'ts', 'int', array(
        'not null' => TRUE,
      ));
      $ret[] = update_sql("CREATE TABLE {deploy_log} (\n        dlid int_unsigned NOT NULL,\n        plan varchar(50) NOT NULL,\n        server varchar(100) NOT NULL,\n        username varchar(60) NOT NULL,\n        ts int NOT NULL,\n        PRIMARY KEY (dlid)\n      )");
      $ret[] = update_sql("CREATE TABLE {deploy_log_details} (\n        dldid int_unsigned NOT NULL,\n        dlid int_unsigned NOT NULL, \n        module varchar(50) NOT NULL,\n        description varchar(75) NOT NULL,\n        result varchar(25) NOT NULL,\n        message varchar(255) NOT NULL,\n        PRIMARY KEY (dldid)\n      )");
      break;
  }
  return $ret;
}