diff options
author | olly <olly@ollycope.com> | 2015-04-16 17:42:48 +0000 |
---|---|---|
committer | olly <olly@ollycope.com> | 2015-04-16 17:42:48 +0000 |
commit | 747f979c875d101f5907fbadd42e076dfd93e36a (patch) | |
tree | bd48b12fdd6b75d68a31396c1dd790ec0555ca6a /README.rst | |
parent | 18b0c5974a13e8ca7eb0cebd25b7082aff2d2947 (diff) | |
download | yoyo-747f979c875d101f5907fbadd42e076dfd93e36a.tar.gz |
Add note about __depends__ to readme
Diffstat (limited to 'README.rst')
-rwxr-xr-x | README.rst | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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. |