Project

General

Profile

DjHDGutilsPatchManager » History » Version 6

Alex V Koval, 08/09/2012 03:12 PM

1 6 Alex V Koval
h1. DjHDGutils.PatchManager
2 1 Alex V Koval
3
h2. patch
4
5
h3. Introduction
6
7
PatchManager makes it easy to support large scale project migrations in the well controlled manner.
8
Patches can be different types, namely:
9
10
 * .sql
11
 * .py
12
13
and they are run in sequentual manner one after one. The migrations are made that way that several developers
14
in a different branches can run their patches, merge them without conflicts (a random number at the end of the
15
patch name makes it low probability to patch names to interfere) and test well before going to production.
16
17
h3. Patch names
18
19
Patches can be named automatically that is for *next* command is made:
20
21
<pre>
22
(env)djyp $ ./manage.py patch next
23
File /someproject/migrations/00636-avk-654.sql has been created
24
	size: 0
25
</pre>
26
27
Filename consists from:
28
29
 * 00636 - patch number
30
 * avk - developer name
31
 * 654 - the random part to ensure that patch names do not interfer with same developer different branch
32
33
h3. Commands
34
35 3 Alex V Koval
* *list* - list pending patches
36
* *install* - install PatchManager track model table
37
* *up* - update project to latest migration
38
* *skip* - skip specific patch
39
* *next* - auto-generate the next available patch name
40 1 Alex V Koval
41
h3. Compare to other systems
42
43
Most of other systems differ by their primary usage. South for example mainly used for distributed project support. Our system
44
is simple and straightforward to use, we always know what patch is going to be installed on a production database.
45 4 Alex V Koval
And so our advantages:
46
47
 * Very simple, robust, reliable application
48
 * No conflicts during merge
49 5 Alex V Koval
50
51
h3. Typical migrate session
52
53
In a typical usage session you do 2 things: 
54
55
 * expect what patches are pending
56
 * apply them
57
58
Or even just directly apply them, as we usually do in our upgrade scripts.
59
60
<pre>
61
./manage.py patch list
62
./manage.py patch up
63
</pre>