Some instructions in the RegisterMigration docstring on how to use.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 9 Jul 2011 20:10:47 +0000 (15:10 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 9 Jul 2011 20:10:47 +0000 (15:10 -0500)
mediagoblin/db/util.py

index c89327552ce47746a64bc6c59e451a29a17786ea..ca1aed746492a8233871da9313ddbc4797079b19 100644 (file)
@@ -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