This is a guide on the naming convention for Competition Results Management System (CRMS)
Fields | Case |
---|---|
Database names | Lower case |
Table names | Pascal case + snake case |
Column names | Lower case + snake case |
Keys and Indexes | Prefix = uppercase |
Refer to the picture below to understand the different case formatting.
Database names will be lowercase (no numbers or special characters like "-/+=", only "_" underscores are allowed).
Table names will be in lowercase and singular. No prefix is required. E.g. athlete, team, sport, etc. If table name has multiple words, concatenate them with an underscore "_". E.g. "Competition Geo Location" --> competition_geo_location.
Naming convention will follow "Parent-Child" relationship. E.g. Athlete results will be named as athlete_result instead of result_athlete
View names will be in lowercase, singular and be prefixed with "vw_". E.g. vw_country.
For many to many tables, table names will be concatenated with 2 underscores '__'. E.g. competition__competition_category.
Column names will be singular and lowercase except for prefixes and suffixes. All prefixes and suffixes should be in lowercase. Column names with more than one word will be joined using underscores '_'
Primary Keys will be prefixed with 'pk_'
Foreign Keys will be prefixed with 'fk_'
Constraints naming will be in the following format: {tablename}{columnname(s)}{suffix} (for primary key just {tablename}_{suffix} will suffice)
Primary Keys will be suffixed with '_pkey'
Foreign Keys will be suffixed with '_fkey'
Indexes will be suffixed with '_idx'
Unique Key constraints will be suffixed with '_key'
Exclusion constraints will be suffixed with '_excl'
Exclusion constraints will be suffixed with '_check'
Sequence will be suffixed with '_seq'
Date fields will be in the format "YYYY-MM-DD"
Date fields will be in the format "YYYY-MM-DD HH:MM:SS"
Time fields will be in the format "HH:MM:SS"