Naming Conventions: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
* '''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 | ||
* 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 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-increment''ing number | * 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-increment''ing number | ||
* If a '''varchar(25)''' is used for the PK instead of a number it allows for better use of certain hash variables such as '''#nu_browse_filter#''' | * If a '''varchar(25)''' is used for the PK instead of a number it allows for better use of certain hash variables such as '''#nu_browse_filter#''' | ||
* Also suggested that <u>Unique Indexes not be used</u>, allowing internal validating rules to check for duplicates. This is because of the way the project implements checking for PK types | * Also suggested that <u>Unique Indexes not be used</u>, 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. | * 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 | ||
* 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''' |
Revision as of 14:00, 29 January 2021
- nuBuilder and DB Normalisation rules requires the use of a Primary Key (PK) for each table
- 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 variables 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
- 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