SBEAMS Driver TablesOverview:The SBEAMS driver tables are two tables within the Core module schema that store detailed information about the tables and columns in a given module. In addition to basic schema information such as table names, key columns, column names and data types, these tables hold information that allow them to be handled generically by a number of SBEAMS modules and scripts. The table names are table_property and table_column, and the information to populate them is stored in tab-delimited text files in the SBEAMS directory structure under sbeams/lib/conf. Each module has its own pair of files, and they are loaded into the database using a perl script called update_driver_tables.pl. See below for more detail on these subjects. Use of driver table info in SBEAMS:
Table Property:Each module has a table property file, which stores information about tables in that module's schema. For instance for the Proteomics module the file is:
table_property: A table_name: a unique name among all SBEAMS modules. Use module prefix before database table name B Category: Friendly title of the table C table_group: a table group for which access security is defined D manage_table_allowed: Set to YES if the ManageTable.cgi program is allowed to drive modifications to this table E db_table_name: a Perl variable for the physical table name. Should be $TB{module prefix}_TABLE_NAME F PK_column_name: column name of the primary autogen key G multi_insert_column: If this table supports multi-insert logic, set to column name H table_url: actual URL used to manage this table. DO NOT CHANGE I manage_tables: a comma-separated list of tables that should be managed as a group J next_step: comma-separated list of tables that might be managed next after a record inserted here Table Column:Each module has a table column file, which stores information about the columns in each of the tables in that module's schema. For instance for the Proteomics module the file is:
table_column: A table_name: a unique name among all SBEAMS modules. Must match entry in sbeams_table_property B column_number: numerical ordered index of columns so order is preserved C column_name: column name in the table D column_title: a friendly title that appears in the form E datatype: datatype of column F scale: scale (e.g. length for VARCHAR) of column G precision: precision (e.g. number of decimal places for NUMERIC) of column H nullable: if column is defined as NULL or NOT NULL I default_value: column default value for database J is_auto_inc: Y if this is an autogen columns (IDENTITY, SERIAL, AUTO_GEN, etc.) K fk_table: If column is a foreign key, what table does it refer to L fk_column_name: If column is a foreign key, what column in the remote table does it refer to M is_required: Does the ManageTable form require that this have some value N input_type: What type of HTML form widget type for entry (text, textarea, textdate, optionlist, multioptionlist,scrolloptionlist,file,fixed) O input_length: Size of the HTML form widget if appropriate P onChange: text for JavaScript onChange code for this widget Q is_data: Y if this is a column that should appear on the form (as opposed to housekeeping column) R is_displayed: Y column should be displayed in a VIEW mode. N column should not be displayed. P Column is private, and should be hidden on forms unless user is owner or admin 2 Column should be displayed if view mode is medium detail. S is_key_field: combination of Y columns will be checked for uniqueness before insertion T column text: Friendly descriptive text that appears on the form for this field U optionlist_query: SQL query which populates an optionlist V url: when this field is displayed in a table, what type of URL is attached to the data (pkDEFAULT means that this column is the referencing PK, SELF means column is URL itself) Updating driver tables:When CREATEing or ALTERing a table, or simply updating any of the associated information in an existing table, the first step is to edit the MOD_table_property.txt and/or MOD_table_column.txt files. The format is tab-delimited text, and some of the fields may be empty, so it is difficult to edit these files with a simple text editor. It is recommended that you a spreadsheet application such as open office or excel to make edits. Once you have made the appropriate changes, you should update the information stored in the database but running the following commands from the sbeams/lib/conf/MODULE directory:
|