I've inherited an app in Django (v1.5) that uses MySQL as the backend. Unfortantly the way that the date is recorded within the table doesnt lend itself well to sorting by date. i.e
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| datey | int(11) | NO | | NULL | |
| datem | int(11) | NO | | NULL | |
| dated | int(11) | NO | | NULL | |
| dateh | int(11) | NO | | NULL | |
| datemin | int(11) | NO | | NULL | |
| dates | int(11) | NO | | NULL | |
| detail | varchar(45) | NO | | NULL | |
+------------+--------------+------+-----+---------+----------------+
Based on this model structure. I need to :
- Add a new field (called rundate) which can store the actual date
- (DateField) Convert all previously entries so they have a populated.
What is best or recommended method to do this without losing all of my previous data ?
Thanks,