AiderSQLDatabase
SQL Aider Conventions
Aider conventions for SQL and database migrations: naming, formatting, and migration patterns.
CONVENTIONS.md
- Use snake_case for all database object names: tables, columns, indexes, functions - Name indexes: idx_<table>_<columns> for regular, uq_<table>_<columns> for unique - Name foreign keys: fk_<child_table>_<parent_table> for clarity - Use timestamptz (not timestamp) for all timestamp columns to avoid timezone bugs - Write migration files as: YYYYMMDDHHMMSS_<verb>_<subject>.sql - Never modify existing migration files; always create new migrations for changes - Add comments to all tables and columns in the migration SQL - Test rollback migration before shipping the forward migration
How to use with Aider
Create a `CONVENTIONS.md` file in your project root. Aider reads this and respects your conventions when generating changes.
#sql#aider#migrations#naming#coding-rules
Related Rules
Python Aider Conventions
AiderPython
Aider AI coding conventions for Python: CONVENTIONS.md patterns for automated refactoring and clean Python code.
Code Style
python · aiderCopy Ready
Next.js Aider Conventions
AiderNext.js
Aider conventions for Next.js: file naming, route organization, and App Router conventions.
Architecture
nextjs · aiderCopy Ready
Security Aider Conventions
Aidersecurity
Aider conventions for security: secure coding patterns, vulnerability prevention, and security review checklist.
Security
security · aiderCopy Ready
Testing Aider Conventions
Aidertesting
Aider conventions for tests: structure, naming, and testing philosophy for maintainable test suites.
Testing
testing · aiderCopy Ready