Skip to content

Commit

Permalink
modified readme'
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosthealex committed Mar 20, 2017
1 parent 4961015 commit c2af902
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ Usage

$ touch my-database.db

3. In *my-migrations* create your first migration, by copying the `example <https://github.com/dragosthealex/limigrations/blob/master/migrations/example_migration.py>`_
and modifying the `up` and `down` methods. Optionally, name it after the date and time e.g. *2017-03-08_12:31*
3. Create your first migration using the command-line, then edit the `up` and `down` methods
::

$ python -m limigrations new --new_migration "users_table" --migrations_dir "my-migrations"

Optionally, you can copy the `example <https://github.com/dragosthealex/limigrations/blob/master/migrations/example_migration.py>`_
and modifying the `up` and `down` methods, saving it in your migrations directory.
It's recommended to name it after the date and time e.g. *2017-03-08_12:31*

Command-Line
"""""""""""""""""
Expand Down
7 changes: 5 additions & 2 deletions limigrations/limigrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
revert the database to the previous state.
This module provides basic migrations functionality for sqlite3.
It contains a method for connecting to the database,
and functions for migrate and rollback.
It contains a method for connecting to the database, a method for
creating new migrations and functions for migrate and rollback.
The migrations are stored in a migrations folder which can be
specified (default being 'migrations'). Although the date when they
Expand All @@ -22,6 +22,9 @@
(...)
lm.rollback('database.db', 'migrations')
$ python -m limigrations.limigrations new --new_migration
"users_table_migration" --migrations_dir "migrations"
(...)
$ python -m limigrations.limigrations migrate --db_file "database.db"
--migrations_dir "migrations"
(...)
Expand Down

0 comments on commit c2af902

Please sign in to comment.