def down(cursor):
    """Put back broken definition"""
    cursor.execute(
        """
SELECT m.module_ident,
    m.portal_type,
    m.moduleid,
    m.uuid,
    m.version,
    m.name,
    m.created,
    m.revised,
    m.abstractid,
    m.licenseid,
    m.doctype,
    m.submitter,
    m.submitlog,
    m.stateid,
    m.parent,
    m.language,
    m.authors,
    m.maintainers,
    m.licensors,
    m.parentauthors,
    m.google_analytics,
    m.buylink,
    m.major_version,
    m.minor_version,
    m.print_style
   FROM modules m
  WHERE m.module_ident = (( SELECT max(modules.module_ident) AS max
           FROM modules
          WHERE m.moduleid = modules.moduleid));
"""
        )
    cursor.execute(
        """DELETE FROM latest_modules WHERE uuid IN
            (SELECT uuid FROM datamigrations.wrong_latest);
            INSERT INTO latest_modules
                SELECT * from datamigrations.wrong_latest;
            DROP TABLE datamigrations.wrong_latest;
            DROP TABLE datamigrations.corrected_latest;"""
        )
