![]() |
BillMax Billing Solutions 877.245.5629 sales@billmax.com |
dbschema — BillMax Database Definition
The files /usr/local/billmax/cfg/dbschema and /usr/local/billmax/cfg/rptschema file is used by alterdb to create or modify tables and indices in the BillMax database and the BillMax reports database. The dbschema file consists of a series of database table and database table index definitions. A dbschema file must be formatted in the following manner:
Each line must begin with one of the following characters:
# - comment line
F - database field definition line
K - database index definition line
A field definition line consists of 8 fields separated by "|". Each field must be present. Consecutive "|"s are not allowed. They must be separated by at least a space. The fields are:
F - specifying a field definition line.
Table name.
Field name.
Field type - the nomenclature is database manufacturer specific.
YES if the field is allowed to be NULL.
Ignored, but field must be present.
Default value for the field when the database record is created.
Additional information about the field. Currently auto_increment is the only non-blank value recognized. If not auto_increment, then a blank after the last "|" must be present.
An index definition consists on one or more index definition lines. An index definition line consists of 5 fields separated by "|". Each field must be present. The fields are:
K - specifying an index definition line.
Table name - the table for which the index will be created.
Index name.
Name of field of included in the index.
Field ordering (beginning with position 1) for the fields in the index. The numbering must be sequential without any gaps.
Example 4.4. note table dbschema entry
F|note|number|int(11)| |PRI|'0'|auto_increment F|note|entdate|date| | |'0000-00-00'| (1) F|note|enttime|time| | |'00:00:00'| F|note|empl|mediumint(8)| | |'0'| F|note|text|text| | |NULL| F|note|fromtable|varchar(20)| |MUL|''| F|note|reference|int(11)| | |'0'| F|note|priority|tinyint(4)| | |'0'| K|note|PRIMARY|number|1 K|note|note_idx|fromtable|1 K|note|note_idx|reference|2
| (1) | Note the blanks in between "|"s and after the last "|". |
![]() |
Warning |
|---|---|
Field definitions should not be modified by the BillMax customer. If they are modified, BillMax will generate unpredictable results. |
Fields may be added, but they will not recognized by BillMax processes.
The most common reason a BillMax customer may want to edit the dbschema file is to add additional database indices. This may be accomplished by adding a new index definition and running alterdb.