~sloecode/sloecode/trunk

« back to all changes in this revision

Viewing changes to dbpatches/README.txt

  • Committer: Thomi Richards
  • Date: 2012-04-01 02:37:11 UTC
  • mfrom: (148.2.1 fix-dbpatches)
  • Revision ID: thomi.richards@canonical.com-20120401023711-0vt8wat9rzexhkg5
Merged code to fix database patching issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
Scripts in this folder are broken into two categories:
6
6
 
7
 
 * Schema definition scripts are used to create the initial database and MUST
8
 
   NOT BE CHANGED, unless you really know what you are doing, and are also 
9
 
   going to change the debian packaging scripts. These scripts are named after
10
 
   the database type, and are stored in the schema directory.
 
7
 * Schema definition scripts are used to create the initial database at install
 
8
   time. These scripts must be kept up-to-date. If a schema change is
 
9
   introduced, you must make sure that the schema files match the current
 
10
   database schema. These scripts are named after the database type, and are
 
11
   stored in the schema directory.
 
12
 
 
13
   Note that the schema file may in fact be applied to an existing database. It
 
14
   must not alter any existing data. So for example, create table statements
 
15
   must be 'CREATE TABLE IF NOT EXISTS'.
11
16
 
12
17
 * Schema patches change the original schema definition over time. They are
13
18
   stored in the patches directory, and are then further separated into 
14
 
   separate folders for database type. Patch scripts are numbered, and must be
15
 
   numbered consecutively. For this reason, if you need to make a change to the
16
 
   database schema, you MUST get a patch number from the code sloecode developers.
 
19
   separate folders for database type. Patch scripts are numbered according to
 
20
   the version of the package they will be installed in. If you are creating
 
21
   the first patch of a new release, you will need to create a new patch file,
 
22
   otherwise append your patch to an existing file.
17
23