def forwards(self, orm):
        "Write your forwards methods here."
        db_table = orm['samples.CohortVariant']._meta.db_table
        db.execute('TRUNCATE TABLE "{0}"'.format(db_table))
        db.execute('ALTER SEQUENCE "{0}_id_seq" RESTART 1'.format(db_table))
        cohorts = list(orm['samples.Cohort'].objects.all())

        for c in cohorts:
            # Calculate frequencies for all variants associated with all
            # samples in this cohort
            db.execute('''
                INSERT INTO cohort_variant (cohort_id, variant_id, af) (
                    SELECT c.id, r.variant_id, COUNT(r.id) / c."count"::float
                    FROM sample_result r
                        INNER JOIN sample s ON (r.sample_id = s.id)
                        INNER JOIN cohort_sample cs ON (cs.sample_id = s.id)
                        INNER JOIN cohort c ON (cs.cohort_id = c.id)
                    WHERE c.id = %s
                    GROUP BY c.id, r.variant_id, c."count"
                )
            ''', [c.pk])
Write your forwards methods here.