1. Mikhail Korobov
  2. django-fab-deploy
  3. Issues
Issue #17 resolved

PostgreSQL support

Mikhail Korobov
repo owner created an issue

No description provided.

Comments (10)

  1. Mikhail Korobov reporter

    Hi Vladimir,

    The file I'm using in a django+postgres project is attached. It provides functions similar to mysql.py but it is not integrated with the rest of django-fab-deploy and don't follow all the conventions.

    'migrate' command also have to be monkey-patched to work with this now:

    from fabric.api import run, env, settings
    from fab_deploy import django_commands
    from fab_deploy.django_commands import manage
    from .postgres import postgres_dump
    def migrate(params='', do_backup=True):
        """ Runs migrate management command. Database backup is performed
        before migrations if ``do_backup=False`` is not passed. """
        if do_backup:
            backup_dir = env.conf['SRC_DIR'] + '/files/backups/before-migrate'
            run('mkdir -p ' + backup_dir)
            with settings(warn_only=True):
        manage('migrate --noinput %s' % params)
    django_commands.migrate = migrate

    Proper postgres support may be implemented like the existing multiple vcs support. Or it can be a part of #32 - rewrite.

  2. Log in to comment