<?php
// $Id: comment_og.install,v 1.1 2008/02/28 10:20:24 rapsli Exp $

/**
 * Implementation of hook_install().
 */
function comment_og_install() {
	switch ($GLOBALS['db_type']) {
		case 'mysql':
		case 'mysqli':
			$status[] = db_query("
        CREATE TABLE {comment_og} (
		  `cid` int(20) NOT NULL,
		  `visibility` int(10) NOT NULL,
		  `ogs` text NOT NULL,
		  PRIMARY KEY  (`cid`)
		) DEFAULT CHARSET=latin1;");
			break;

	}

	// If there is one FALSE value in the status array, there was an error.
	if (array_search(FALSE, $status) !== FALSE) {
		drupal_set_message(t('Table installation for the comment_og module was unsuccessful. The tables may need to be installed by hand.'), 'error');
	}
	else {
		drupal_set_message(t('comment_og module installed successfully.'));
	}
}

function comment_og_uninstall() {
  db_query('DROP TABLE {comment_og}');
}