diff options
author | olly <olly@ollycope.com> | 2013-04-15 13:42:55 +0200 |
---|---|---|
committer | olly <olly@ollycope.com> | 2013-04-15 13:42:55 +0200 |
commit | ff9da43b3bd963b1b49bcb1ea7dbfa0dd8c87474 (patch) | |
tree | 12dd573735f2c747b2aad1fca0fe4acf0d31b664 | |
parent | cfc57d15e4a4bc8103bad1a6f3dcbe1a7539ac5c (diff) | |
download | yoyo-ff9da43b3bd963b1b49bcb1ea7dbfa0dd8c87474.tar.gz |
Bumped version, updated readme, changelog etc
Bumped version to 4.2.0dev (to reflect package namespace change), and added
notes about package namespace change, plus tidied up readme and added an
example of calling yoyo programmatically
-rw-r--r-- | CHANGELOG.rst | 19 | ||||
-rw-r--r-- | README.rst | 31 | ||||
-rw-r--r-- | VERSION.txt | 2 |
3 files changed, 38 insertions, 14 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 55ca988..e6f0d0c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,21 @@ CHANGELOG --------- +Version 4.2.0 + +* Removed yoyo.migrate namespace package. Any code that uses the yoyo api + directly needs have any imports modified, eg this:: + + from yoyo.migrate import read_migrations + from yoyo.migrate.connections import connect + + Should be changed to this:: + + from yoyo import read_migrations + from yoyo.connections import connect + +* Migrated from darcs to mercurial. Code is now hosted at + https://bitbucket.org/ollyc/yoyo + Version 4.1.6 * Added windows support (thanks to Peter Shinners) @@ -31,7 +47,8 @@ Version 4.1.1 Version 4.1.0 -* Introduced ability to run steps within a transaction +* Introduced ability to run steps within a transaction (thanks to Ryan Williams + for suggesting this functionality along with assorted bug fixes.) * "post-apply" migrations can be run after every successful upward migration @@ -1,7 +1,7 @@ -Yoyo-migrations -=============== +Yoyo database migrations +======================== -Yoyo-migrations is a database schema migration tool using plain SQL and the +Yoyo is a database schema migration tool using plain SQL and python's builtin DB-API. What does yoyo-migrations do? @@ -10,9 +10,9 @@ What does yoyo-migrations do? As database applications evolve, changes to the database schema are often required. These can usually be written as one-off SQL scripts containing CREATE/ALTER table statements (although any SQL or python script may be used -with yoyo-migrations). +with yoyo). -Yoyo-migrations provides a command line tool for reading a directory of such +Yoyo provides a command line tool for reading a directory of such scripts and applying them to your database as required. Database support @@ -24,18 +24,18 @@ PostgreSQL, MySQL and SQLite databases are supported. Usage ----- -Yoyo-migrations is usually invoked as a command line script. +Yoyo is usually invoked as a command line script. Examples: Read all migrations from directory ``migrations`` and apply them to a PostgreSQL database:: - yoyo-migrate apply ./migrations/ postgres://user:password@localhost/database + yoyo-migrate apply ./migrations/ postgres://user:password@localhost/database Rollback migrations previously applied to a MySQL database:: - yoyo-migrate rollback ./migrations/ mysql://user:password@localhost/database + yoyo-migrate rollback ./migrations/ mysql://user:password@localhost/database Reapply (ie rollback then apply again) migrations to a SQLite database at location ``/home/sheila/important-data.db``:: @@ -160,10 +160,17 @@ your command history when you have moved to a different directory). If you do not want this cache file to be used, add the ``--no-cache`` parameter to the command line options. -Thanks ------- +Using yoyo from python code +--------------------------- -* Thanks to Ryan Williams for suggesting the transactions functionality and - assorted bug fixes. +The following example shows how to apply migrations from inside python code:: + + from yoyo import read_migrations + from yoyo.connections import connect + + conn, paramstyle = connect('postgres://myuser@localhost/mydatabase') + migrations = read_migrations(conn, paramstyle, 'path/to/migrations')) + migrations.to_apply().apply() + conn.commit() .. :vim:sw=4:et diff --git a/VERSION.txt b/VERSION.txt index 09c9aaa..0f746bb 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -4.1.7dev +4.2.0dev |