| 1 |
<?php |
<?php |
| 2 |
// $Id: stock.install,v 1.3 2008/09/22 03:58:45 kbahey Exp $ |
// $Id: stock.install,v 1.3.2.1 2008/10/26 02:51:31 kbahey Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_install() |
* Implementation of hook_install() |
|
* |
|
|
* This will automatically install the MySQL & PostgreSQL database tables for Stock module. |
|
|
* |
|
| 6 |
*/ |
*/ |
| 7 |
function stock_schema() { |
function stock_schema() { |
| 8 |
$schema['stock'] = array( |
$schema['stock'] = array( |
| 10 |
'fields' => array( |
'fields' => array( |
| 11 |
'uid' => array( |
'uid' => array( |
| 12 |
'description' => t('the user id'), |
'description' => t('the user id'), |
| 13 |
'type' => 'int', |
'type' => 'int', |
| 14 |
'not null' => 'TRUE', |
'not null' => 'TRUE', |
| 15 |
'default' => '0'), |
'default' => '0'), |
| 16 |
'symbols' => array( |
'symbols' => array( |
| 17 |
'description' => t('the stock symbol'), |
'description' => t('the stock symbol'), |
| 18 |
'type' => 'varchar', |
'type' => 'varchar', |
| 19 |
'length' => 255, |
'length' => 255, |
| 20 |
'not null' => TRUE, |
'not null' => TRUE, |
| 21 |
'default' => ''), |
'default' => ''), |
| 22 |
), |
), |
| 23 |
'primary key' => array('uid'), |
'primary key' => array('uid'), |
| 24 |
); |
); |
| 25 |
return $schema; |
return $schema; |
| 26 |
} |
} |
| 27 |
|
|
| 28 |
function stock_install() { |
function stock_install() { |
| 29 |
drupal_install_schema('stock'); |
drupal_install_schema('stock'); |
| 30 |
} |
} |