<?php

// Add the bank field
if (self::$db_alter->fetch_table_info('user'))
{
	self::$db_alter->add_field(array(
		'name'       => 'dbtech_vbshop_bank',
		'type'       => 'double',
		'null'       => false,	// True = NULL, false = NOT NULL
		'default'    => '0'
	));
	self::report('Altered Table', 'user');
}

// Add lottery table
self::$db->query_write("
	CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "dbtech_vbshop_ticket` (
	`ticketid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
	`userid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
	`dateline` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
	`itemid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0',
	`active` ENUM( '1', '0' ) NOT NULL DEFAULT '1',
	`numbers` TEXT NOT NULL ,
	INDEX ( `itemid` , `active` ) 
	) ENGINE = MYISAM ;
");
self::report('Created Table', 'dbtech_vbshop_ticket');