Initial commit
This commit is contained in:
5
skills/database-conventions/reference/INDEX.md
Normal file
5
skills/database-conventions/reference/INDEX.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Database Conventions Reference Index
|
||||
|
||||
- **[field-naming.md](field-naming.md)** - Complete naming conventions
|
||||
- **[indexing.md](indexing.md)** - Index patterns and strategies
|
||||
- **[relationships.md](relationships.md)** - Foreign keys and relations
|
||||
7
skills/database-conventions/reference/field-naming.md
Normal file
7
skills/database-conventions/reference/field-naming.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Field Naming Conventions
|
||||
|
||||
**Boolean:** `is_active`, `has_access`, `can_edit`
|
||||
**Timestamp:** `created_at`, `updated_at`, `deleted_at`
|
||||
**Foreign Key:** `user_id`, `tenant_id`, `organization_id`
|
||||
**Email:** `email_address` (not `email`)
|
||||
**Phone:** `phone_number` (not `phone`)
|
||||
12
skills/database-conventions/reference/indexing.md
Normal file
12
skills/database-conventions/reference/indexing.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Indexing Strategies
|
||||
|
||||
**Always index:**
|
||||
- tenant_id
|
||||
- Foreign keys
|
||||
- Unique constraints
|
||||
- Frequently queried fields
|
||||
|
||||
**Composite indexes:**
|
||||
```typescript
|
||||
index("users_tenant_email_idx").on(users.tenant_id, users.email_address)
|
||||
```
|
||||
7
skills/database-conventions/reference/relationships.md
Normal file
7
skills/database-conventions/reference/relationships.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Relationships Guide
|
||||
|
||||
**One-to-Many:** User has many Posts
|
||||
**Many-to-One:** Post belongs to User
|
||||
**Many-to-Many:** User has many Roles through UserRoles
|
||||
|
||||
See examples for complete patterns.
|
||||
Reference in New Issue
Block a user