Merge branch 'master' into almet/cors

This commit is contained in:
Alexis Metaireau 2018-12-25 18:13:26 +01:00 committed by GitHub
commit 978198baa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View file

@ -6,8 +6,10 @@ This document describes changes between each past release.
3.1 (unreleased) 3.1 (unreleased)
---------------- ----------------
Added
=====
- Add CORS headers in the API (#407) - Add CORS headers in the API (#407)
- Document database migrations (#390)
3.0 (2018-11-25) 3.0 (2018-11-25)
---------------- ----------------

View file

@ -61,6 +61,11 @@ create-database-revision: ## Create a new database revision
@read -p "Please enter a message describing this revision: " rev_message; \ @read -p "Please enter a message describing this revision: " rev_message; \
$(PYTHON) -m ihatemoney.manage db migrate -d ihatemoney/migrations -m "$${rev_message}" $(PYTHON) -m ihatemoney.manage db migrate -d ihatemoney/migrations -m "$${rev_message}"
.PHONY: create-empty-database-revision
create-empty-database-revision: ## Create an empty database revision
@read -p "Please enter a message describing this revision: " rev_message; \
$(PYTHON) -m ihatemoney.manage db revision -d ihatemoney/migrations -m "$${rev_message}"
.PHONY: build-requirements .PHONY: build-requirements
build-requirements: ## Save currently installed packages to requirements.txt build-requirements: ## Save currently installed packages to requirements.txt
$(VIRTUALENV) $(TEMPDIR) $(VIRTUALENV) $(TEMPDIR)

View file

@ -39,7 +39,6 @@ Accessing dev server
In any case, you can point your browser at `http://localhost:5000 <http://localhost:5000>`_. In any case, you can point your browser at `http://localhost:5000 <http://localhost:5000>`_.
It's as simple as that! It's as simple as that!
Updating Updating
-------- --------
@ -47,6 +46,22 @@ In case you want to update to newer versions (from git), you can just run the "u
make update 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. You can edit the generated script. eg: to add data migrations.
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 Useful settings
---------------- ----------------