Skip to content
This repository

Fixed migration to actually work (forwards & backwards). #36

Merged
merged 1 commit into from almost 2 years ago

2 participants

Jaap Roes Benjamin Liles
Jaap Roes
jaap3 commented

Using Django 1.4 and South 0.7.4 I was unable to get past migration 0002. This patch fixes the forwards and backwards methods.

Benjamin Liles benliles merged commit bce269e into from
Benjamin Liles benliles closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 13, 2012
Jaap Roes Fixed migration to actually work (forwards & backwards). 3b82ebe
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 5 deletions. Show diff stats Hide diff stats

  1. 7  djangopypi/migrations/0002_refactoring.py
7  djangopypi/migrations/0002_refactoring.py
@@ -105,7 +105,7 @@ def forwards(self, orm):
105 105
         db.add_column('djangopypi_release', 'hidden', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep_default=False)
106 106
 
107 107
         # Adding field 'Release.created'
108  
-        db.add_column('djangopypi_release', 'created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default='', blank=True), keep_default=False)
  108
+        db.add_column('djangopypi_release', 'created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default='1970-01-01 00:00:00', blank=True), keep_default=False)
109 109
 
110 110
         # Removing unique constraint on 'Release', fields ['project', 'platform', 'distribution', 'version', 'pyversion']
111 111
         db.delete_unique('djangopypi_release', ['project_id', 'platform', 'distribution', 'version', 'pyversion'])
@@ -156,9 +156,6 @@ def backwards(self, orm):
156 156
         # Removing M2M table for field maintainers on 'Package'
157 157
         db.delete_table('djangopypi_package_maintainers')
158 158
 
159  
-        # Adding field 'Classifier.id'
160  
-        db.add_column('djangopypi_classifier', 'id', self.gf('django.db.models.fields.AutoField')(default='', primary_key=True), keep_default=False)
161  
-
162 159
         # Changing field 'Classifier.name'
163 160
         db.alter_column('djangopypi_classifier', 'name', self.gf('django.db.models.fields.CharField')(max_length=255, unique=True))
164 161
 
@@ -169,7 +166,7 @@ def backwards(self, orm):
169 166
         db.add_column('djangopypi_release', 'filetype', self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), keep_default=False)
170 167
 
171 168
         # Adding field 'Release.upload_time'
172  
-        db.add_column('djangopypi_release', 'upload_time', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default='', blank=True), keep_default=False)
  169
+        db.add_column('djangopypi_release', 'upload_time', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default='1970-01-01 00:00:00', blank=True), keep_default=False)
173 170
 
174 171
         # Adding field 'Release.pyversion'
175 172
         db.add_column('djangopypi_release', 'pyversion', self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True), keep_default=False)
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.