diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-09 15:10:47 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-09 15:10:47 -0500 |
commit | 363fc97259bac58b8b9a933cbdf301ab6cd584b3 (patch) | |
tree | 97413aa515f4a62c9f5b169f8223c0ec9514bc25 /mediagoblin/db/util.py | |
parent | dca6406a90227c72dd6e0661d8cd26556a44606b (diff) | |
download | mediagoblin-363fc97259bac58b8b9a933cbdf301ab6cd584b3.tar.lz mediagoblin-363fc97259bac58b8b9a933cbdf301ab6cd584b3.tar.xz mediagoblin-363fc97259bac58b8b9a933cbdf301ab6cd584b3.zip |
Some instructions in the RegisterMigration docstring on how to use.
Diffstat (limited to 'mediagoblin/db/util.py')
-rw-r--r-- | mediagoblin/db/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py index c8932755..ca1aed74 100644 --- a/mediagoblin/db/util.py +++ b/mediagoblin/db/util.py @@ -121,6 +121,19 @@ MIGRATIONS = {} class RegisterMigration(object): """ Tool for registering migrations + + Call like: + + @RegisterMigration(33) + def update_dwarves(database): + [...] + + This will register your migration with the default migration + registry. Alternately, to specify a very specific + migration_registry, you can pass in that as the second argument. + + Note, the number of your migration should NEVER be 0 or less than + 0. 0 is the default "no migrations" state! """ def __init__(self, migration_number, migration_registry=MIGRATIONS): self.migration_number = migration_number |