move over the relevant logs migrations/417-migrate-logs.py (bug 760464)

This commit is contained in:
Andy McKay 2012-06-01 11:59:32 -07:00
Родитель 8884d85fad
Коммит 95586b8f58
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,14 @@
from django.db import connection, transaction
def run():
cursor = connection.cursor()
cursor.execute('select activity_log_id from log_activity_app;')
ids = [r[0] for r in cursor.fetch_all()]
cursor.execute('insert into log_activity_app_mkt '
'select * from log_activity_app;')
cursor.execute('insert into log_activity_mkt '
'select * from log_activity where id IN %(ids)s;',
{'ids':ids})
transaction.commit()