Skip to content

Commit 6409b88

Browse files
Add SQL review standards documentation
1 parent 28c2f13 commit 6409b88

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.bytebase/sql-review.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# .bytebase/sql-review.md
2+
# SQL Review Standards
3+
4+
## 1. Table Naming Convention
5+
- All table names must be in snake_case
6+
- Table names should be plural nouns (e.g., users, orders, products)
7+
- Avoid abbreviations unless commonly understood
8+
9+
## 2. Column Standards
10+
- Every table must have a created_at timestamp column
11+
- Every table must have an updated_at timestamp column
12+
- Primary key columns should be named 'id'
13+
14+
## 3. Index Requirements
15+
- Foreign key columns must have indexes
16+
- Columns used in WHERE clauses frequently should be indexed
17+
18+
## 4. Comment Requirements
19+
- All tables must have descriptive comments
20+
- Complex columns should have comments explaining their purpose
21+
22+
## 5. Type Consistency
23+
- Use TEXT instead of VARCHAR for string columns
24+
- Use TIMESTAMP for datetime values
25+
- Use BIGINT for auto-incrementing primary keys

0 commit comments

Comments
 (0)