예제 #1
0
        "before performing the backup!",
        metavar="DIR",
    )
    cmd.parser.add_option(
        "--restore-files",
        dest="restore_files_dir",
        help="Restore the dumped thumbnails and media files from DIR to "
        "MediaCore's configured storage locations. "
        "WARNING: this flag will delete all files from its destination "
        "directories before performing a restore!",
        metavar="DIR",
    )
    cmd.parser.add_option(
        "--debug", action="store_true", dest="debug", help="Write debug output to STDOUT.", default=False
    )
    load_app(cmd)
    DEBUG = cmd.options.debug


# BEGIN SCRIPT & SCRIPT SPECIFIC IMPORTS
import os
import sys
import select
import shutil
import commands
import subprocess
import urlparse
from pylons import config
from webob.exc import HTTPNotFound
from mediacore.model.meta import DBSession
from mediacore.model import *
예제 #2
0
Specify your ini config file as the first argument to this script.

This script simply assigns your database the correct migrate version
and runs all pending migrations since then. After running this script
you will not need to use another update script -- simply run
paster setup-app development.ini to apply any pending migrations."""
DEBUG = False

if __name__ == "__main__":
    cmd = LoadAppCommand(_script_name, _script_description)
    cmd.parser.add_option('--debug',
                          action='store_true',
                          dest='debug',
                          help='Write debug output to STDOUT.',
                          default=False)
    load_app(cmd)
    DEBUG = cmd.options.debug

# BEGIN SCRIPT & SCRIPT SPECIFIC IMPORTS
import sys
from migrate.versioning.api import version_control, version, upgrade
from migrate.versioning.exceptions import DatabaseAlreadyControlledError
from pylons import config

initial_version = 0
migrate_repository = 'mediacore/migrations'


def main(parser, options, args):
    engine_url = config['sqlalchemy.url']
    latest_version = version(migrate_repository)