summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorolly <olly@ollycope.com>2015-04-16 17:42:48 +0000
committerolly <olly@ollycope.com>2015-04-16 17:42:48 +0000
commit747f979c875d101f5907fbadd42e076dfd93e36a (patch)
treebd48b12fdd6b75d68a31396c1dd790ec0555ca6a /README.rst
parent18b0c5974a13e8ca7eb0cebd25b7082aff2d2947 (diff)
downloadyoyo-747f979c875d101f5907fbadd42e076dfd93e36a.tar.gz
Add note about __depends__ to readme
Diffstat (limited to 'README.rst')
-rwxr-xr-xREADME.rst17
1 files changed, 16 insertions, 1 deletions
diff --git a/README.rst b/README.rst
index b1d6ca3..631404b 100755
--- a/README.rst
+++ b/README.rst
@@ -67,8 +67,23 @@ example::
"DROP TABLE foo",
)
+Migrations may also declare dependencies on previous migrations via the
+``__depends__`` attribute::
+
+ #
+ # file: migrations/0002.modify-foo.py
+ #
+ __depends__ = ['0001.create-foo']
+
+ step(
+ "CREATE TABLE foo (id INT, bar VARCHAR(20), PRIMARY KEY (id))",
+ "DROP TABLE foo",
+ )
+
+
The filename of each file (without the .py extension) is used as the identifier
-for each migration. Migrations are applied in filename order, so it's useful to
+for each migration. In the absence of a ``__depends__`` attribute, migrations
+are applied in filename order, so it's useful to
name your files using a date (eg '20090115-xyz.py') or some other incrementing
number.