Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squash migrations #247

Merged
merged 2 commits into from
Nov 17, 2016
Merged

Squash migrations #247

merged 2 commits into from
Nov 17, 2016

Conversation

ntrncic
Copy link
Collaborator

@ntrncic ntrncic commented Nov 11, 2016

No description provided.

@robertavram
Copy link
Member

robertavram commented Nov 11, 2016

#247 comment script in here @ntrncic # #214

@ntrncic
Copy link
Collaborator Author

ntrncic commented Nov 11, 2016

Delete all custom app rows from django_migrations table

from django.db import connection
from users.models import (
   Country
)
from django.db.migrations.recorder import MigrationRecorder
country_list = Country.objects.all()
for country in country_list:
    # set tenant for country
    connection.set_tenant(country)
    print country
    MigrationRecorder.Migration.objects.filter(app__in=[
        'partners', 'reports', 'trips',
        'locations', 'funds', 'users', 'workplan', 'vision', 'tpm']).delete()

Fake migrations:
python manage.py migrate_schemas partners --fake
python manage.py migrate_schemas trips --fake
python manage.py migrate_schemas workplan --fake
python manage.py migrate_schemas vision --fake
python manage.py migrate_schemas tpm --fake

@robertavram robertavram modified the milestones: Release 3, Sprint 1 Nov 15, 2016
@robertavram
Copy link
Member

@ntrncic please update your comment to include all fake migrations for all apps....

@ntrncic ntrncic added the READY label Nov 16, 2016
@ntrncic
Copy link
Collaborator Author

ntrncic commented Nov 16, 2016

@robertavram some apps are dependent on others therefore only the 5 mentioned need to be run.
if you run the other apps it just says no migrations to be applied.

@robertavram
Copy link
Member

cool.. waiting for tomorrow afternoon... let's try together

@robertavram robertavram changed the base branch from staging to develop November 17, 2016 19:42
@robertavram robertavram merged commit 6150d4c into develop Nov 17, 2016
@ewheeler ewheeler deleted the squash_migrations branch August 3, 2017 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
eTools
Ready
Development

Successfully merging this pull request may close these issues.

None yet

2 participants