FinanceFerret/2.0/sql/trx

From Woozle Writes Code
< FinanceFerret‎ | 2.0‎ | sql
Revision as of 18:34, 22 August 2019 by htyp>Woozle (Created page with "==About== * '''purpose''': base transaction, to which transaction parts are attached * '''rules''': a transaction: ** must have exactly one source part ** must have exactly on...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • purpose: base transaction, to which transaction parts are attached
  • rules: a transaction:
    • must have exactly one source part
    • must have exactly one target part
    • may have zero or more equity parts, but they must total ≤Amount

SQL

CREATE TABLE `Transactions` (
  `ID`           INT(4)           NOT NULL auto_increment,
  `ID_Type`      INT(4)       default NULL COMMENT "[trx_type].ID",
  `Amount`       DECIMAL(9,2) default NULL COMMENT "Amount added to ID_Acct account",
  `Voided`       tinyint(1)   default FALSE COMMENT "transaction voided",
  `IsApprox`     tinyint(1)   default NULL COMMENT "exact amount of transaction is not known yet",  PRIMARY KEY  (`ID`),
  KEY `Acct` (`ID_Acct`)
) ENGINE=InnoDB;