Add page on migrations
New page: database migration basics
Briefly describe the new page you wish to add to the documentation. Please keep in mind, that while we want Beautiful Canoe documentation to be comprehensive, we also want it to be readable and approachable. Wherever possible, we prefer to add to existing documentation rather than create new pages here.
- Who is the intended audience for the new page? All new developers working on projects with databases and deployments
- What value do you expect them to find in the new information? How to write, maintain and test database migrations, with a good understanding of why these things are important
This page should cover the basics of writing database migrations. More specifically:
- Motivation: why we need migrations and what happens if we don't have them
- Common migration commands:
- Status / info / etc.
- Migration patterns with examples:
- Adding a new table
- Adding a new column to a table
- Deleting a table
- Deleting a column in a table
- Fixing broken data
- Restructuring one or more tables (and why we should avoid this wherever possible)
- Testing migrations: best practices
- Running migrations up and down
- Running migrations before unit tests
- Example: testing migrations in Laravel
Where in the navigation structure of the website should your page appear?
- Start here
- Using Git
- Web security
- PHP projects
- Unity Projects
- Phone apps
- Static websites
- Starting a new project
- Infrastructure (full time staff only)
This should go in a new section called either Databases, or Coding for deployment (thoughts @a.garcia-dominguez ?).
We want to avoid putting this page in a language-specific section, as it will be relevant to a number of technology stacks.