зеркало из https://github.com/mozilla/domesday.git
Added schematic.
This commit is contained in:
Родитель
eafc1bef56
Коммит
5527311ed3
|
@ -16,7 +16,7 @@ Database
|
|||
|
||||
* `django-multidb-router <https://github.com/jbalogh/django-multidb-router>`_:
|
||||
Round-robin master/slave db router for Django 1.2.
|
||||
* `schematic <https://github.com/jbalogh/schematic>`_:
|
||||
* `schematic <https://github.com/jbalogh/schematic>`_\*:
|
||||
Simple database migration tool.
|
||||
|
||||
Deferred Execution (cron, message queues)
|
||||
|
|
|
@ -38,6 +38,11 @@ except ImportError:
|
|||
" Please come back and try again later.")
|
||||
raise
|
||||
|
||||
# If we want to use django settings anywhere, we need to set up the required
|
||||
# environment variables.
|
||||
setup_environ(settings)
|
||||
|
||||
# Configure Celery
|
||||
import djcelery
|
||||
djcelery.setup_loader()
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
-- Example database migration for schematic. Remove this, if you like.
|
|
@ -0,0 +1,30 @@
|
|||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
# Set up playdoh.
|
||||
import manage
|
||||
from django.conf import settings
|
||||
|
||||
config = settings.DATABASES['default']
|
||||
config['HOST'] = config.get('HOST', 'localhost')
|
||||
config['PORT'] = config.get('PORT', '3306')
|
||||
|
||||
if not config['HOST'] or config['HOST'].endswith('.sock'):
|
||||
"""Oh, you meant 'localhost'!"""
|
||||
config['HOST'] = 'localhost'
|
||||
|
||||
s = 'mysql --silent {NAME} -h{HOST} -u{USER}'
|
||||
|
||||
if config['PASSWORD']:
|
||||
s += ' -p{PASSWORD}'
|
||||
else:
|
||||
del config['PASSWORD']
|
||||
if config['PORT']:
|
||||
s += ' -P{PORT}'
|
||||
else:
|
||||
del config['PORT']
|
||||
|
||||
db = s.format(**config)
|
||||
table = 'schema_version'
|
2
vendor
2
vendor
|
@ -1 +1 @@
|
|||
Subproject commit 50f7ed7ae3a1980d03ee04f8bb9004e3e69cb8a9
|
||||
Subproject commit 8b719f776a3280a9cad439f9def6e238b9843dc3
|
Загрузка…
Ссылка в новой задаче