'Write your forwards methods here.'

def forwards(self, orm):

    db.commit_transaction()
    for project in RangeQuerySetWrapperWithProgressBar(orm.Project.objects.all()):
        orm.Environment.objects.filter(project_id=project.id, organization_id__isnull=True).update(organization_id=project.organization_id)
    for environment in RangeQuerySetWrapperWithProgressBar(orm.Environment.objects.all()):
        try:
            with transaction.atomic():
                orm.EnvironmentProject.objects.create(environment=environment, project_id=environment.project_id)
        except IntegrityError:
            pass
    db.start_transaction()
