From 5b5956d86dc1131c2cfdd587dc6abf476c30bd6d Mon Sep 17 00:00:00 2001 From: 0livd Date: Sat, 13 Oct 2018 18:36:08 +0200 Subject: Document database migrations Closes #390 --- docs/contributing.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'docs/contributing.rst') diff --git a/docs/contributing.rst b/docs/contributing.rst index 836dc08..b27e3f9 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -39,7 +39,6 @@ Accessing dev server In any case, you can point your browser at `http://localhost:5000 `_. It's as simple as that! - Updating -------- @@ -47,6 +46,21 @@ In case you want to update to newer versions (from git), you can just run the "u make update +Create database migrations +-------------------------- + +In case you need to modify the database schema, first update the models in ihatemoney/models.py. +Then run the following command to create a new database revision file:: + + make create-database-revision + +If your changes are simple enough, the generated script will be populated with +the necessary migrations steps. +For complex migrations, it is recommended to start from an empty revision file which can be created +with the following command:: + + make create-empty-database-revision + Useful settings ---------------- -- cgit v1.1