VirtueMart - 1.1 Developer's Guide

Page of 44
Database
32
5.4.3.1. "Whoops! I checked in the wrong thing!"
Once a change has been committed you cannot un-commit it. You have to reverse the change and
check in a new revision with the old code.
Sometimes you might have a number of changes in your working copy which should be committed
separately but accidentally get committed all at once with a commit message that's only appropriate to
one of the changes. The safe thing to do is revert the inadvertent commits then re-commit them with
the right message; editing the repository directly is possible but foolishly dangerous.
5.4.3.2. "Whoops! I cocked up a 
svn import
!"
Getting an import right is important because it affects the long-term usefulness of the repository. Check
import commands particularly carefully before running them!
If you do make a mistake, the solution depends on exactly what went wrong. You might have run the
command in the wrong working directory, or you might have used the wrong repository path, etc. The
important point is whether the imported files coincide with files in the repository or not.
1. If none of the files in the erroneous import have the same name as an existing file in the repository
(e.g.  they  all  ended  up  in  a  completely  new  directory)  then  just  removing  the  files  from  the
repository can be done by using the appropriate 
rm
 command in the repository.
2. If  the  import  is  OK  apart  from  an  incorrect  tag,  the  tag  can  probably  be  deleted  and  re-applied
correctly without too much pain. (This may not be true for a misspelled vendor branch tag.)
3. If there is a filename clash with an unrelated file, then there's a fairly serious problem. Find a SVN
guru and help him or her to fix the repository manually. You won't be popular.
5.5. Database
Changes to the main db schema require a that an upgrade patch is posted as well. Your change will
be backed out if you don't provide a patch as well.
5.5.1. Changelog!
First of all you need to make an entry in the Changelog, including the SQL Queries to update a database
scheme.
5.5.2. SQL Update File
All changes to the database scheme are collected in an SQL file. There's a file for each minor version
jump, e.g.
UPDATE-SCRIPT_com_virtuemart_1.0.x-to-1.1.0.sql
The file can be found in the subdirectory /sql.
A user must see which version of VirtueMart this SQL patch file applies to and to which version it
updates the db scheme.
In this case the SQL file would update a db scheme from version
VirtueMart 1.0.x to 1.1.0