From e77c30bc4ac2d4af8c902f943c6f766f20f9ae61 Mon Sep 17 00:00:00 2001 From: olly Date: Tue, 17 Sep 2013 11:59:54 +0000 Subject: Updated README, CHANGELOG --- CHANGELOG.rst | 8 ++++++++ README.rst | 4 ++++ 2 files changed, 12 insertions(+) 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 diff --git a/README.rst b/README.rst index 6eb1c71..dd8aa10 100644 --- a/README.rst +++ b/README.rst @@ -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))", -- cgit v1.2.1