Skip to content

Commit

Permalink
Making documentation work better on Github.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermechapiewski committed Mar 18, 2009
1 parent ba342ee commit 056acd1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
5 changes: 3 additions & 2 deletions NOTICE.txt
Expand Up @@ -2,7 +2,8 @@ The simple-db-migrate is developed by:

Guilherme Chapiewski (http://gc.blog.br)
Contact: guilherme.chapiewski at gmail.com
Project Website: http://simple-db-migrate.lighthouseapp.com
Project Website: http://guilhermechapiewski.github.com/simple-db-migrate/
Issue tracker: http://simple-db-migrate.lighthouseapp.com

This software is distributed for free, under Apache License version 2.0.
See LICENSE.txt for more details.
See LICENSE.txt for more details.
36 changes: 16 additions & 20 deletions DOCUMENTATION.txt → README.textile
@@ -1,22 +1,20 @@
simple-db-migrate documentation
-------------------------------
h1. simple-db-migrate "quick" documentation

QUICK START
===========
h2. Quick start

simple-db-migrate is damn simple. The best way to understand how it works is installing and using it.

You can install it by typing:

$ sudo python setup.py install
$ sudo easy_install simple-db-migrate

There are more detailed instructions and information about installing directly from source on the "project website":http://guilhermechapiewski.github.com/simple-db-migrate.

After installing, for usage tips type:

$ db-migrate --help


UNDERSTANDING HOW IT WORKS
==========================
h2. Understanding how it works

The first thing you'll need is a migration file. There are some example migration files on the "example" directory. The migration files have the following format:

Expand All @@ -27,13 +25,16 @@ The first thing you'll need is a migration file. There are some example migratio
PRIMARY KEY (id)
);
"""

SQL_DOWN = """
DROP TABLE aleatory;
"""

... where SQL_UP and SQL_DOWN are two strings that contains respectively the SQL statements to upgrade and downgrade the database schema.

You can use db-migrate to create the migrations by typing:

$ db-migrate --create create_table_users

The file names need to respect the format "YYYYMMDDHHMMSS_migration_description.migration". simple-db-migrate uses the YYYYMMDDHHMMSS information to track the database schema version and to decide the order of execution of the scripts. simple-db-migrate will go through all .migration files in your directory and execute all of them in their creation (date) order.

Second, you have to configure access to your MySQL database so simple-db-migrate can execute DDL. Just create a file named "simple-db-migrate.conf" located in your migrations dir, with the following content (there is also an example on the "example" directory):
Expand All @@ -45,31 +46,26 @@ Second, you have to configure access to your MySQL database so simple-db-migrate

You don't need to create the database. simple-db-migrate will create it for you.

After this two things ou are ready to go. Just navigate to your migrations directory and type:
After this two things you are ready to go. Just navigate to your migrations directory and type:

$ db-migrate

If you don't want to navigate to the directory, you can specify it path instead. In this case you will also need to specify the path to the config file. Note that this also makes it possible to use any name you like for the config file:

$ db-migrate --dir=path/to/migrations/dir --config=path/to/file.conf


MIGRATING TO A SPECIFIC VERSION
===============================
h2. Migrating to a specific version

If you want you can migrate your database schema to specific version by informing the --version parameter. The version id is the YYYYMMDDHHMMSS identifier used at the migration file:

$ db-migrate --version=20090227000129

If you don't specify any version, simple-db-migrate will migrate the schema to the latest version available on the migrations directory.

h2. Roadmap, bug reporting and feature requests

ROADMAP, BUG REPORTING AND FEATURE REQUESTS
===========================================

Go to the project's ticket system at http://simple-db-migrate.lighthouseapp.com/projects/25437-simple-db-migrate/overview.
For detailed info about future versions, bug reporting and feature requests, go to the project's ticket system at "Lighthouse":http://simple-db-migrate.lighthouseapp.com/projects/25437-simple-db-migrate/overview.

h2. Other questions

OTHER QUESTIONS
===============
Mail me at "guilherme.chapiewski at gmail.com".
Mail me at "guilherme.chapiewski at gmail.com" for further questions.

0 comments on commit 056acd1

Please sign in to comment.