diff options
author | olly <olly@ollycope.com> | 2013-09-17 11:59:54 +0000 |
---|---|---|
committer | olly <olly@ollycope.com> | 2013-09-17 11:59:54 +0000 |
commit | e77c30bc4ac2d4af8c902f943c6f766f20f9ae61 (patch) | |
tree | 20f44db500be3506debc3e028d23897d4823b55d | |
parent | 7e41138d95072f3736fd00cd5078b58fe44ce03e (diff) | |
download | yoyo-e77c30bc4ac2d4af8c902f943c6f766f20f9ae61.tar.gz |
Updated README, CHANGELOG
-rw-r--r-- | CHANGELOG.rst | 8 | ||||
-rw-r--r-- | README.rst | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 81ea322..f35e255 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,13 @@ CHANGELOG --------- +Version 4.2.2 + +* Migration scripts can start with ``from yoyo import step, transaction``. + This prevents linters (eg flake8) throwing errors over undefined names. + +* Bugfix: functions declared in a migration file can access the script's global + namespace + Version 4.2.1 * Bugfix for previous release, which omitted critical files @@ -61,6 +61,7 @@ example:: # # file: migrations/0001.create-foo.py # + from yoyo import step step( "CREATE TABLE foo (id INT, bar VARCHAR(20), PRIMARY KEY (id))", "DROP TABLE foo", @@ -83,6 +84,7 @@ regardless:: # # file: migrations/0001.create-foo.py # + from yoyo import step step( "CREATE TABLE foo (id INT, bar VARCHAR(20), PRIMARY KEY (id))", "DROP TABLE foo", @@ -95,6 +97,7 @@ their single argument. For example:: # # file: migrations/0002.update-keys.py # + from yoyo import step def do_step(conn): cursor = conn.cursor() cursor.execute( @@ -116,6 +119,7 @@ You can run multiple steps within a single transaction by wrapping them in a # # file: migrations/0001.create-foo.py # + from yoyo import step, transaction transaction( step( "CREATE TABLE foo (id INT, bar VARCHAR(20), PRIMARY KEY (id))", |