Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2529c2d

Browse files
added docs for alembic migrations
1 parent cafb558 commit 2529c2d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ src/*
1111
*.pytest_cache
1212
tests/*.cache
1313
*.cache
14+
*.coverage
1415

1516
# removing doc builds
1617
docs/_build/*

docs/guides/contribution.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ All our tests can be run using the following command:
2323
$ python -m pytest ether_sql/tests/
2424
2525
26+
Updating the database tables
27+
----------------------------
28+
29+
We use `Alembic <http://alembic.zzzcomputing.com/en/latest/tutorial.html>`_ to
30+
handle database migrations.
31+
32+
You can create new tables by adding a new class in the :code:`ether_sql/models` module. More details on available columns are available at `SQLAlchemy guides <http://docs.sqlalchemy.org/en/latest/orm/tutorial.html>`_
33+
34+
To create SQL commands that can reflect the changes in the database, run the following command.
35+
36+
37+
.. code :: shell
38+
39+
$ ether_sql sql migrate -m "message for changes"
40+
41+
Next upgrade the database using the following command:
42+
43+
.. code :: shell
44+
45+
$ ether_sql sql upgrade
46+
2647
Updating the docs
2748
-----------------
2849

0 commit comments

Comments
 (0)