Difference between revisions of "Naming Conventions"

From nuBuilderForte
Jump to: navigation, search
m
 
Line 5: Line 5:
 
* Delimit each word in table and field name with an underscore (_). eg., '''grand_total'''
 
* Delimit each word in table and field name with an underscore (_). eg., '''grand_total'''
  
* Add a 3 letter lowercase prefix followed by an underscore (_) to each field name
+
* Add a 3 letter lowercase prefix followed by an underscore (_) to each field which is derived from the table name
  
 
* '''nuBuilder''' and [https://www.guru99.com/database-normalization.html DB Normalisation rules] requires the use of a Primary Key ('''PK''') for each table
 
* '''nuBuilder''' and [https://www.guru99.com/database-normalization.html DB Normalisation rules] requires the use of a Primary Key ('''PK''') for each table

Latest revision as of 21:54, 1 April 2021

  • All table names are singular and lowercase
  • All field names are lowercase
  • Delimit each word in table and field name with an underscore (_). eg., grand_total
  • Add a 3 letter lowercase prefix followed by an underscore (_) to each field which is derived from the table name
  • Suggested that the PK be the name of the table followed by an underscore (_) and the letters id. eg., person_id
  • Suggested that the PK should be a varchar(25), as it will automatically be populated by nuBuilder using the function called nuID() (when filled out as suggested), unless the PK is an auto-incrementing number
  • If a varchar(25) is used for the PK instead of a number it allows for better use of certain hash cookies such as #nu_browse_filter#
  • Also suggested that Unique Indexes not be used, allowing internal validating rules to check for duplicates. This is because of the way the project implements checking for PK types
  • Foreign Keys (FK) should bear the shortname of the table as a prefix followed by an underscore (_) and then the original parent table's PK it refers to

Getting Started

  • Display and Input formatting are stored in the respective system tables (zzzzsys_*) such as format, form, browse and report tables.
  • Start with own set of tables or have nuBuilder create them on the fly with standard field types that can be altered (do not change the default ID field).
  • All nuBuilder application tables must necessarily have VARCHAR(25) field type for the primary key ID if auto generated in the globeadmin mode.
  • Existing tables with other field types like AUTO_INCREMENT INT fields must have their ID fields generated for new records with BeforeSave PHP code or use NULL for AUTO_INCREMENT definitions in the DB itself.
  • Alternatively, the primary key ID (auto generated or manually made) should follow the VARCHAR(25) convention and keep a unique (INT or other) key for what would have been their primary key outside of nuBuilder.