

def forwards(self, orm):
    try:
        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()):
            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:
        LOG.exception('failed to create tables')

dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/migrations/0008_documentpermission_m2m_tables.py Migration.forwards/original