postgresql - Django 1.3 - BooleanField to DateTimeField Migration Fails -


working django 1.3 on postgres 9.1.

i've been tasked migrating 2 old bool fields pulled , mail_report timestamps.

in attempting migrate following error, i'm not sure how around outside of manually removing non-null constraint in database allow me cast of records null. django.db.utils.databaseerror: column "pulled" cannot cast type timestamp time zone

any insight getting around doesn't involve me manually tinkering our live database appreciated.

model declaration changes:

     # reporting checked flags      # pulled => object has been processed through order_picklist -    pulled = models.booleanfield(default=false) +    pulled = models.datetimefield(blank=true, null=true, default=none)      # mail_report => object has been processed through report_mailing_list -    mail_report = models.booleanfield(default=false) +    mail_report = models.datetimefield(blank=true, null=true, default=none) 

you should read the data migration section in south's docs. there, teach how change plain-text password hashed one. accomplish this, need retain value of current passwords , convert them.

my advice go, step step migrations likes this:

  1. create new datetimes column names: pulled2, mail_report2
  2. create data migration populate columns depending on boolean value in respectives columns pulled , mail_report
  3. create migration delete boolean columns pulled , mail_report
  4. create last migration rename pulled2 , mail_report2 pulled , mail_report

hope outline , the tutorials in docs helpful!


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -