Skip to content

Instantly share code, notes, and snippets.

@streeter
Created May 7, 2013 16:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save streeter/5534008 to your computer and use it in GitHub Desktop.
Save streeter/5534008 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.execute('UPDATE auth_user SET password=CONCAT("bcrypt", SUBSTR(password, 3)) WHERE password LIKE "bc$%%"')
def backwards(self, orm):
db.execute('UPDATE auth_user SET password=CONCAT("bc", SUBSTR(password, 7)) WHERE password LIKE "bcrypt$%%"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment