def unapply_migration(self, name, statements, fake=False):
import MySQLdb
connection = self.get_connection()
cursor = connection.cursor()
try:
if not fake:
cursor.execute(statements)
except (MySQLdb.OperationalError, MySQLdb.ProgrammingError) as e:
print('\n'.join(map(str, e.args)))
from sqlibrist.helpers import ApplyMigrationFailed
raise ApplyMigrationFailed
else:
cursor.execute('DELETE FROM sqlibrist_migrations '
'WHERE migration = (%s); ', [name])
评论列表
文章目录