Commit 51992e1c authored by Sli's avatar Sli

Mailing migration

parent 72d968e9
...@@ -1335,6 +1335,13 @@ def migrate_forum(): ...@@ -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(): ...@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment