From 9f14de31ec1f78a2f2847d7a2c9b8efb775adab9 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 19 Dec 2015 12:15:13 -0500 Subject: Slightly better suggestions for creating the Alembic file. --- src/mailman/docs/DATABASE.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/mailman/docs/DATABASE.rst') diff --git a/src/mailman/docs/DATABASE.rst b/src/mailman/docs/DATABASE.rst index ed513b841..b27b1f788 100644 --- a/src/mailman/docs/DATABASE.rst +++ b/src/mailman/docs/DATABASE.rst @@ -71,19 +71,16 @@ something in the models, what steps are needed to reflect that change in the database schema? You need to create and enter a virtual environment, install Mailman into that, and then run the ``alembic`` command. For example:: - $ virtualenv -p python3 /tmp/mm3 + $ python3 -m venv /tmp/mm3 $ source /tmp/mm3/bin/activate $ python setup.py develop + $ mailman info $ alembic -c src/mailman/config/alembic.cfg revision --autogenerate -m "" + $ deactivate This would create a new migration which would automatically be migrated to the -database on the next run of Mailman. Note that the database needs to be in -the older state so that Alembic can track the changes in the schema and -autogenerate a migration. If you don't have the database in the older state -you can remove the `--autogenerate` flag in the above command. It would then -create a new empty revision which you can edit manually to reflect your -changes in the database schema. +database on the next run of Mailman. People upgrading Mailman from previous versions need not do anything manually, as soon as a new migration is added in the sources, it will be automatically -- cgit v1.2.3-70-g09d2