Skip to content

Instantly share code, notes, and snippets.

@klyonrad
Created March 3, 2023 09:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klyonrad/27782a5a686f6edf3b34a2c64aefb7fc to your computer and use it in GitHub Desktop.
Save klyonrad/27782a5a686f6edf3b34a2c64aefb7fc to your computer and use it in GitHub Desktop.
MySavedReplies

Appendix

Add helpful information here:

Content Description

Database checklist

When adding migrations:

  • Updated db/schema.rb
  • The db/schema.rb does not contain changes from other branches
  • Migration is revertible
  • Added the output of the migration(s) to the PR body
  • Added tests for the migration in spec/migrations if necessary (e.g. when migrating data)
  • Added rollback procedure. Include either a rollback procedure or description how to rollback changes

When adding or modifying queries to improve performance:

  • Included data that shows the performance improvement, preferably in the form of a benchmark
  • Included the output of EXPLAIN (ANALYZE, BUFFERS) of the relevant queries

When adding foreign keys to existing tables:

  • Included a migration to remove orphaned rows in the source table before adding the foreign key
  • Removed any instances of dependent: ... that may no longer be necessary

When adding tables:

  • Ordered columns based on the Ordering Table Columns guidelines
  • Added foreign keys to any columns pointing to data in other tables
  • Added indexes for fields that are used in statements such as WHERE, ORDER BY, GROUP BY, and JOINs

When removing columns, tables, indexes or other structures:

  • Removed these in a post-deployment migration
  • Made sure the application no longer uses (or ignores) these structures

(Checklist inspired by Gitlab project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment