File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments