Write your forwards methods here.

def forwards(self, orm):
        "Write your forwards methods here."
        db.execute('DELETE FROM cohort_variant')
        db.execute('DELETE FROM cohort_sample')
        db.execute('DELETE FROM cohort')

        samples = orm['samples.Sample'].objects.filter(published=True)
        count = samples.count()
        cohort = orm['samples.Cohort'](name='World', autocreated=True,
            published=bool(count), count=count)
        cohort.save()

        cohort_samples = []
        for sample in samples:
            cohort_samples.append(orm['samples.CohortSample'](object_set=cohort, set_object=sample))

        orm['samples.CohortSample'].objects.bulk_create(cohort_samples)

        for project in orm['samples.Project'].objects.all():
            samples = orm['samples.Sample'].objects.filter(published=True, project=project)
            count = samples.count()
            cohort = orm['samples.Cohort'](project=project, name=project.label,
                autocreated=True, published=bool(count), count=count)
            cohort.save()

            cohort_samples = []
            for sample in samples:
                cohort_samples.append(orm['samples.CohortSample'](object_set=cohort, set_object=sample))

            orm['samples.CohortSample'].objects.bulk_create(cohort_samples)

        for batch in orm['samples.Batch'].objects.select_related():
            samples = orm['samples.Sample'].objects.filter(published=True, batch=batch)
            count = samples.count()
            cohort = orm['samples.Cohort'](batch=batch, project=batch.project,
                name='{0}: {1}'.format(batch.project.label, batch.label), autocreated=True,
                published=bool(count), count=count)
            cohort.save()

            cohort_samples = []
            for sample in samples:
                cohort_samples.append(orm['samples.CohortSample'](object_set=cohort, set_object=sample))

            orm['samples.CohortSample'].objects.bulk_create(cohort_samples)