Main menu

Transaction Table

Submitted by mikehostetler on Thu, 04/26/2007 - 08:38

The transaction table is the core of the application. It records amounts of inventory moving from one area to another. It also implements a Single Table Inheritance pattern to capture data about different types of transactions.

<?php
--
--
Table structure for table <code>transaction</code>
--

CREATE TABLE <code>transaction</code> (
  <
code>transaction_id</code> int(10) unsigned NOT NULL auto_increment,
  <
code>debit_account_id</code> int(10) unsigned NOT NULL default '0',
  <
code>credit_account_id</code> int(10) unsigned NOT NULL default '0',
  <
code>created</code> datetime NOT NULL default '0000-00-00 00:00:00',
  <
code>date</code> date NOT NULL default '0000-00-00',
  <
code>category_id</code> int(10) unsigned NULL default '0',
  <
code>amount</code> double(10,2) NOT NULL default '0.00',
  <
code>memo</code> text,
  <
code>batch_number</code> int(10) default '0',
  <
code>unit_number</code> int(10) default '0',
  <
code>ia_number</code> int(10) default '0',
  <
code>fma_number</code> int(10) default '0',
  <
code>cases</code> int(10) default '0',
  <
code>html_tag</code> text,
 
PRIMARY KEY  (<code>transaction_id</code>),
 
KEY <code>IDX_transaction_debit_account_id</code> (<code>debit_account_id</code>),
 
KEY <code>IDX_transaction_credit_account_id</code> (<code>credit_account_id</code>),
 
KEY <code>IDX_transaction_category_id</code> (<code>category_id</code>),
 
KEY <code>IDX_transaction_batch_number</code> (<code>batch_number</code>),
 
KEY <code>IDX_transaction_unit_number</code> (<code>unit_number</code>),
 
KEY <code>IDX_transaction_ia_number</code> (<code>ia_number</code>),
 
KEY <code>IDX_transaction_fma_number</code> (<code>fma_number</code>),
 
KEY <code>IDX_transaction_cases</code> (<code>cases</code>),
 
KEY <code>IDX_transaction_date</code> (<code>date</code>),
 
KEY <code>IDX_transaction_created</code> (<code>created</code>)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
?>
Taxonomy upgrade extras: