Skip to content

Instantly share code, notes, and snippets.

View dguaraglia's full-sized avatar

David Guaraglia dguaraglia

  • MerQube
  • Minnesota
View GitHub Profile
# 2010-10-02 14h00
# Update created field in user_prefs table
def migrate(db):
with db.select('user_id, created', from_='users'):
all_users = db.fetchall()
for user in all_users:
with db.update('user_prefs') as obj:
obj.created = user['created']
db.where('user_id = %s', user['user_id'])