If you’re creating a database MR for review, check out our Database review guidelines.
It provides an introduction on database-related changes, migrations, and complex SQL queries.
If you’re a database reviewer or want to become one, check out our introduction to reviewing database changes.
- Understanding EXPLAIN plans
explain.depesz.com or explain.dalibo.com for visualizing the output of
- pgFormatter a PostgreSQL SQL syntax beautifier
- What requires downtime?
- SQL guidelines for working with SQL queries
- Migrations style guide for creating safe SQL migrations
- Testing Rails migrations guide
- Post deployment migrations
- Background migrations
- Swapping tables
- Deleting migrations
- Tracing the source of an SQL query using query comments with Marginalia
- Tracing the source of an SQL query in Rails console using Verbose Query Logs
- Adding database indexes
- Foreign keys & associations
- Adding a foreign key constraint to an existing column
- Strings and the Text data type
- Single table inheritance
- Polymorphic associations
- Serializing data
- Hash indexes
- Storing SHA1 hashes as binary
- Iterating tables in batches
- Insert into tables in batches
- Ordering table columns
- Verifying database capabilities
- Database Debugging and Troubleshooting
- Query Count Limits
- Creating enums