Skip to content

Commit

Permalink
Merge pull request #9172 from dimagi/domain-migration
Browse files Browse the repository at this point in the history
Register domains db migration
  • Loading branch information
dannyroberts committed Nov 19, 2015
2 parents 4dcc1bd + 0c915e2 commit b235ae2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions corehq/doctypemigrations/migrator_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
)
)

domains_migration = Migrator(
slug='domains',
source_db_name=None,
target_db_name=settings.NEW_DOMAINS_DB,
doc_types=('Domain',)
)


def get_migrator_by_slug(slug):
return Migrator.instances[slug]
Expand Down
14 changes: 11 additions & 3 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,9 @@
NEW_FIXTURES_DB = 'fixtures'
FIXTURES_DB = NEW_FIXTURES_DB

NEW_DOMAINS_DB = 'domains'
DOMAINS_DB = None

COUCHDB_APPS = [
'api',
'app_manager',
Expand All @@ -1077,7 +1080,6 @@
'ctable',
'custom_data_fields',
'hqadmin',
'domain',
'ext',
'facilities',
'fluff_filter',
Expand Down Expand Up @@ -1148,13 +1150,19 @@

# fixtures
('fixtures', FIXTURES_DB),

# domains
('domain', DOMAINS_DB),
]

COUCHDB_APPS += LOCAL_COUCHDB_APPS

COUCHDB_DATABASES = make_couchdb_tuples(COUCHDB_APPS, COUCH_DATABASE)
EXTRA_COUCHDB_DATABASES = get_extra_couchdbs(COUCHDB_APPS, COUCH_DATABASE,
[NEW_USERS_GROUPS_DB, NEW_FIXTURES_DB])
EXTRA_COUCHDB_DATABASES = get_extra_couchdbs(COUCHDB_APPS, COUCH_DATABASE, (
NEW_USERS_GROUPS_DB,
NEW_FIXTURES_DB,
NEW_DOMAINS_DB,
))

INSTALLED_APPS += LOCAL_APPS

Expand Down

0 comments on commit b235ae2

Please sign in to comment.