Name
DEV-05: Use source controlled files to maintain the “reference” copy of your stored routines
Synopsis
Source code control systems (SCCSs) allow us to keep copies of major revisions of our program source code, allowing us to roll back an application’s source code to an earlier point in time or to examine the source code in use with an earlier version of the application (which might still be in use somewhere). Virtually all professional software developers could—or at least should—employ an SCCS to store their application code.
Unfortunately, developers often fail to source control the
DDL code to create database objects and often neglect to include
stored program code in the SCCS. To some extent, the ability to
extract the source code for a stored program from the database
encourages us to edit a stored program “in place”—even when we
would never dream of editing PHP code “in place” (e.g., directly
editing the .php
files in the
Apache document directory).
If your stored programs are part of an application, then the source program code is just as much a part of the application source code as code written in other languages such as PHP or Java. You should therefore keep the “reference” copy of your stored program code in your version control system (such as CVS, ClearCase, BitKeeper, etc.). This means saving your stored program code as a text file and performing explicit check-in and check-out from your version control system.
Think of that text file as the original source code for ...
Get MySQL Stored Procedure Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.