LinkORB Engineering
Rule: Avoid redundant comments if field details are evident
Rationale: Refrain from including information in descriptions that are available in another form. For example, in the name of the field, its relation, in a dev pattern, etc. If you can ascertain a field's meaning solely based on those elements, omit the comment altogether.
The redundant comment is removed.
+--------+----------+---------+
| column | type | comment |
+--------+----------+---------+
| id | integer* | |
+--------+----------+---------+
Auto Increment is used on all tables, so the Primary Key (PK) indication with an asterisk is unnecessary.
+--------+----------+---------------------+
| column | type | comment |
+--------+----------+---------------------+
| id | integer* | Autoincrementing PK |
| | | |
| | | |
| | | |
+--------+----------+---------------------+
Rule: Exclude system behavior from database comments
Rationale: If a behavioral description of the main functions of the system exists, and as such, it includes fields used in this behavior, then this information should not be in the database comment.
Rule: Enum and Categorical Field Comment Guidelines
Rationale: The following sub-rules apply to enums and enum-like/categorical fields:
+------------+--------+----------------------------------------------------+
| column | type | comment |
+------------+--------+----------------------------------------------------+
| event_type | string | 'Status update' reflects operational |
| | | changes or software updates. 'Performance metric' |
| | | pertains to monitoring system or application |
| | | performance, including response times and |
| | | resource usage. |
+------------+--------+----------------------------------------------------+
Case 3 applies: a soft enum with two values. The values should be defined.
+------------+--------+--------------------+
| column | type | comment |
+------------+--------+--------------------+
| event_type | string | Specifies the type |
| | | of event. |
| | | |
+------------+--------+--------------------+
Rule: Prefer clear column names over explanatory comments
Rationale: In cases where a column name is ambiguous, it's often better to rename the field to provide clarity rather than relying on comments to explain its meaning.
Field renamed so comment is not needed.
+----------------+----------+
| column | type |
+----------------+----------+
| scheduled_date | datetime |
| | |
+----------------+----------+
"At" implies when the study was scheduled, not the scheduled date.
+--------------+----------+-----------------------+
| column | type | comment |
+--------------+----------+-----------------------+
| scheduled_at | datetime | Scheduled date and |
| | | time of a particular |
| | | study. |
+--------------+----------+-----------------------+
Rule: Adapt database comments to specific database requirements
Rationale: If these situations outlined in the other rules are conditional to some databases, then individual databases might have different types/qualities of comments. Hence, it is crucial to evaluate the rules applicable to each database at an individual database level.
#databases
)