Mailing migration

This commit is contained in:
Antoine Bartuccio 2017-08-19 17:17:16 +02:00
parent 72d968e9a5
commit 51992e1c30

View File

@ -1335,6 +1335,13 @@ def migrate_forum():
def migrate_mailings(): def migrate_mailings():
cur = db.cursor(MySQLdb.cursors.SSDictCursor) cur = db.cursor(MySQLdb.cursors.SSDictCursor)
print("Delete all mailings")
Mailing.objects.all().delete()
print("Migrating old database")
mailing_db = cur.execute(""" mailing_db = cur.execute("""
SELECT * FROM mailing SELECT * FROM mailing
""") """)
@ -1384,6 +1391,7 @@ def main():
# reset_sas_moderators() # reset_sas_moderators()
# migrate_forum() # migrate_forum()
# reset_index('forum') # reset_index('forum')
migrate_mailings()
end = datetime.datetime.now() end = datetime.datetime.now()
print("End at %s" % end) print("End at %s" % end)
print("Running time: %s" % (end - start)) print("Running time: %s" % (end - start))