Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
alembig upgrade head
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Pablo Scaletti committed Aug 28, 2015
1 parent c3eccb7 commit f053438
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
9 changes: 2 additions & 7 deletions README.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This app uses [Alembic](http://alembic.readthedocs.org/en/latest/) to manage dat

Use this command every time you or somebody in your team has updated the database schema:

$ python manage.py syncdb
$ alembig upgrade head

https://sqlalchemy-searchable.readthedocs.org/en/latest/alembic_migrations.html

Expand All @@ -46,16 +46,11 @@ If you add anything by hand remember to modify both the upgrade and downgrade me

Do:

$ python manage.py syncdb
$ alembig upgrade head

to run the generated migration on your local database.


### Manually Run the Migrations

$ alembic upgrade head


### Reset Migrations

To prune old migration files, simply delete the files. Then, in the earliest, still-remaining migration file, set down_revision to None:
Expand Down
25 changes: 0 additions & 25 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,13 @@
from __future__ import print_function
import io
import os
from os.path import dirname, join

from alembic import command
from alembic.config import Config
import baker

from webapp.main import app
from webapp.auth import manage


@baker.command
def syncdb(revision='head'):
"""Run the database migrations
"""
print('\n-- Updating to the latest revision --')
alembic_cfg = Config(join(dirname(__file__), 'alembic.ini'))
command.upgrade(alembic_cfg, revision)

print('\n-- Done. --\n')


@baker.command
def revertdb(revision):
"""Revert the database to the given revision
"""
print('\n-- Downgrade --')
alembic_cfg = Config(join(dirname(__file__), 'alembic.ini'))
command.downgrade(alembic_cfg, revision)

print('\n-- Done. --\n')


@baker.command
def run(host='0.0.0.0', port=None, **kwargs):
"""Runs the application on the local development server.
Expand Down
2 changes: 2 additions & 0 deletions webapp/config/common.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ LOGGING_CONFIG = {
}

MEMCHACHED_SERVERS = []

DEBUG_TB_INTERCEPT_REDIRECTS = False

0 comments on commit f053438

Please sign in to comment.