def forwards(self, orm):
        try:
            # Adding M2M table for field users on 'DocumentPermission'
            if 'documentpermission_users' not in connection.introspection.table_names():
                db.create_table('documentpermission_users', (
                    ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
                    ('documentpermission', models.ForeignKey(orm['desktop.documentpermission'], null=False)),
                    ('user', models.ForeignKey(orm['auth.user'], null=False))
                ))
                db.create_unique('documentpermission_users', ['documentpermission_id', 'user_id'])

            if 'documentpermission_groups' not in connection.introspection.table_names():
                # Adding M2M table for field groups on 'DocumentPermission'
                db.create_table('documentpermission_groups', (
                    ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
                    ('documentpermission', models.ForeignKey(orm['desktop.documentpermission'], null=False)),
                    ('group', models.ForeignKey(orm['auth.group'], null=False))
                ))
                db.create_unique('documentpermission_groups', ['documentpermission_id', 'group_id'])
        except:
            # Only want to make sure that these tables exist.
            # The previous migration should create these tables,
            # but it has been refactored to do so.
            LOG.exception('failed to create tables')
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/migrations/0008_documentpermission_m2m_tables.py/Migration.forwards/original