<?php
// $Id$

function pavi_schema(){
	$schema['pavi'] = array(
	'description' => t('HOLDS THE DETAILS OF ALL THE PRODUCTS .'),
    'fields' => array(
		'ProductCode' => array('description' => t('Contains THE CODE for the product'),
			'type' => 'varchar',
			 'length' => 20,
			'not null' => TRUE,
			'length' => 20,
		),
		'ProductName' => array(
			'description' => t('Contains THE NAME for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length' => 20,
		),
		'ProductDesc' => array(
			'description' => t('Contains THE Descrition for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'BaseUoM' => array(
			'description' => t('Contains THE Base UOM for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'ProductType' => array(
			'description' => t('Contains THE type for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'ProductGroup' => array(
			'description' => t('Contains THE Grooup for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'PlantCode' => array(
			'description' => t('Contains THE plant code for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'Blocked' => array(
			'description' => t('Contains THE blocked /unblocked for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'UpdatedBy' => array(
			'description' => t('Contains THE Author for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>20,
		),
		'Status' => array(
			'description' => t('Contains THE Status for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>20,
		),
		'Comment' => array(
			'description' => t('Contains THE Comment for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>100,
		),
		'EnteredFrom' => array(
			'description' => t('Contains THE Status for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>20,
		)
	),
	'primary key' => array('ProductCode	')
	);
	
	return $schema;

}


function pavi_update_6200(){

  $ret=array();
  
  db_create_table($ret,'pavi',array('description' => t('HOLDS THE DETAILS OF ALL THE PRODUCTS .'),
   'fields' => array(
		'ProductCode' => array('description' => t('Contains THE CODE for the product'),
			'type' => 'varchar',
			 'length' => 20,
			'not null' => TRUE,
			'length' => 20,
		),
		'ProductName' => array(
			'description' => t('Contains THE NAME for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length' => 20,
		),
		'ProductDesc' => array(
			'description' => t('Contains THE Descrition for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5
		),
		'BaseUoM' => array(
			'description' => t('Contains THE Base UOM for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'ProductType' => array(
			'description' => t('Contains THE type for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'ProductGroup' => array(
			'description' => t('Contains THE Grooup for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'PlantCode' => array(
			'description' => t('Contains THE plant code for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
		'Blocked' => array(
			'description' => t('Contains THE blocked /unblocked for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>5,
		),
				'UpdatedBy' => array(
			'description' => t('Contains THE Author for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>20,
		),
		'Status' => array(
			'description' => t('Contains THE Status for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>20,
		),
		'Comment' => array(
			'description' => t('Contains THE Comment for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>100,
		),
		'EnteredFrom' => array(
			'description' => t('Contains THE Status for the product'),
			'type' => 'varchar',
			'not null' => TRUE,
			'length'=>20,
		)
	),
	'primary key' => array('ProductCode	')));
	
	

}


//standard functions to create and destroy
//the tables on install and uninstall
function pavi_install() {
	//create shift_scheduler tables	
	drupal_install_schema('pavi');
}

function pavi_uninstall(){
	//drop shift_scheduler talbes
  drupal_uninstall_schema('pavi');
}
			
	
	
