<?php

// Add the bank field
if (self::$db_alter->fetch_table_info('dbtech_vbshop_category'))
{
	self::$db_alter->add_field(array(
		'name'       => 'shoptypes',
		'type'       => 'int',
		'length'	 => '10',
		'attributes' => 'unsigned',
		'null'       => false,	// True = NULL, false = NOT NULL
		'default'    => '3'
	));
	self::$db_alter->add_field(array(
		'name'       => 'permissions',
		'type'       => 'mediumtext',
		'null'       => true,	// True = NULL, false = NOT NULL
		'default'    => NULL
	));	
	self::$db->query_write("
		UPDATE " . TABLE_PREFIX . "dbtech_vbshop_category
		SET shoptypes = 3
	");
	self::$db->query_write("
		DELETE FROM " . TABLE_PREFIX . "datastore
		WHERE title = 'dbtech_vbshop_category'
	");	
	self::report('Altered Table', 'dbtech_vbshop_category');
}

// Add the bank field
if (self::$db_alter->fetch_table_info('dbtech_vbshop_item'))
{
	self::$db->hide_errors();
	self::$db->query_write("
		ALTER TABLE " . TABLE_PREFIX . "dbtech_vbshop_item
		ADD giftpm ENUM ('0', '1') NOT NULL DEFAULT '1'
	");
	self::$db->show_errors();
	self::$db->query_write("
		DELETE FROM " . TABLE_PREFIX . "datastore
		WHERE title = 'dbtech_vbshop_item'
	");	
	self::report('Altered Table', 'dbtech_vbshop_item');
}