Permalink
Browse files

Merge branch 'feature/migration-fixes' into develop

  • Loading branch information...
2 parents d6b9873 + a4d1585 commit 9185818ab56113c4af98bf6a09420f76d656dc42 @stefanfoulis stefanfoulis committed Jun 5, 2014
@@ -3,18 +3,27 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
+
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerfile', 'cmsplugin_filer_file_filerfile'),
+ )
+
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerFile.target_blank'
db.add_column('cmsplugin_filerfile', 'target_blank',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerFile.target_blank'
db.delete_column('cmsplugin_filerfile', 'target_blank')
@@ -117,4 +126,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_file']
+ complete_apps = ['cmsplugin_filer_file']
@@ -3,20 +3,28 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerfile', 'cmsplugin_filer_file_filerfile'),
+ )
+
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerFile.style'
- db.add_column(u'cmsplugin_filer_file_filerfile', 'style',
+ db.add_column(u'cmsplugin_filerfile', 'style',
self.gf('django.db.models.fields.CharField')(default='', max_length=255, blank=True),
keep_default=False)
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerFile.style'
- db.delete_column(u'cmsplugin_filer_file_filerfile', 'style')
+ db.delete_column(u'cmsplugin_filerfile', 'style')
models = {
@@ -118,4 +126,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_file']
+ complete_apps = ['cmsplugin_filer_file']
@@ -3,20 +3,27 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerfolder', 'cmsplugin_filer_folder_filerfolder'),
+ )
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerFolder.style'
- db.add_column(u'cmsplugin_filer_folder_filerfolder', 'style',
+ db.add_column(u'cmsplugin_filerfolder', 'style',
self.gf('django.db.models.fields.CharField')(default='list', max_length=50),
keep_default=False)
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerFolder.style'
- db.delete_column(u'cmsplugin_filer_folder_filerfolder', 'style')
+ db.delete_column(u'cmsplugin_filerfolder', 'style')
models = {
@@ -71,7 +78,7 @@ def backwards(self, orm):
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
u'cmsplugin_filer_folder.filerfolder': {
- 'Meta': {'object_name': 'FilerFolder', '_ormbases': ['cms.CMSPlugin']},
+ 'Meta': {'object_name': 'FilerFolder', 'db_table': "'cmsplugin_filerfolder'", '_ormbases': ['cms.CMSPlugin']},
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'folder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Folder']"}),
'style': ('django.db.models.fields.CharField', [], {'default': "'list'", 'max_length': '50'}),
@@ -101,4 +108,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_folder']
+ complete_apps = ['cmsplugin_filer_folder']
@@ -3,15 +3,24 @@
from south.db import db
from south.v2 import DataMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
+
class Migration(DataMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerfolder', 'cmsplugin_filer_folder_filerfolder'),
+ )
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
+ # rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
for obj in orm['cmsplugin_filer_folder.filerfolder'].objects.all():
obj.style = obj.view_option
obj.save()
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
for obj in orm['cmsplugin_filer_folder.filerfolder'].objects.all():
obj.view_option = obj.style
obj.save()
@@ -68,7 +77,7 @@ def backwards(self, orm):
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
u'cmsplugin_filer_folder.filerfolder': {
- 'Meta': {'object_name': 'FilerFolder', '_ormbases': ['cms.CMSPlugin']},
+ 'Meta': {'object_name': 'FilerFolder', 'db_table': "'cmsplugin_filerfolder'", '_ormbases': ['cms.CMSPlugin']},
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'folder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Folder']"}),
'style': ('django.db.models.fields.CharField', [], {'default': "'list'", 'max_length': '50'}),
@@ -3,18 +3,25 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerfolder', 'cmsplugin_filer_folder_filerfolder'),
+ )
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerFolder.view_option'
- db.delete_column(u'cmsplugin_filer_folder_filerfolder', 'view_option')
+ db.delete_column(u'cmsplugin_filerfolder', 'view_option')
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerFolder.view_option'
- db.add_column(u'cmsplugin_filer_folder_filerfolder', 'view_option',
+ db.add_column(u'cmsplugin_filerfolder', 'view_option',
self.gf('django.db.models.fields.CharField')(default='x', max_length=10),
keep_default=False)
@@ -71,7 +78,7 @@ def backwards(self, orm):
'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
},
u'cmsplugin_filer_folder.filerfolder': {
- 'Meta': {'object_name': 'FilerFolder', '_ormbases': ['cms.CMSPlugin']},
+ 'Meta': {'object_name': 'FilerFolder', 'db_table': "'cmsplugin_filerfolder'", '_ormbases': ['cms.CMSPlugin']},
u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
'folder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Folder']"}),
'style': ('django.db.models.fields.CharField', [], {'default': "'list'", 'max_length': '50'}),
@@ -100,4 +107,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_folder']
+ complete_apps = ['cmsplugin_filer_folder']
@@ -3,17 +3,23 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
+
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerimage', 'cmsplugin_filer_image_filerimage'),
+ )
def forwards(self, orm):
-
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerImage.file_link'
db.add_column('cmsplugin_filerimage', 'file_link', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='+', null=True, blank=True, to=orm['filer.File']), keep_default=False)
def backwards(self, orm):
-
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerImage.file_link'
db.delete_column('cmsplugin_filerimage', 'file_link_id')
@@ -3,18 +3,25 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerimage', 'cmsplugin_filer_image_filerimage'),
+ )
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerImage.use_original_image'
db.add_column('cmsplugin_filerimage', 'use_original_image',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerImage.use_original_image'
db.delete_column('cmsplugin_filerimage', 'use_original_image')
@@ -188,4 +195,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_image']
+ complete_apps = ['cmsplugin_filer_image']
@@ -3,18 +3,25 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerimage', 'cmsplugin_filer_image_filerimage'),
+ )
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerImage.target_blank'
db.add_column('cmsplugin_filerimage', 'target_blank',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerImage.target_blank'
db.delete_column('cmsplugin_filerimage', 'target_blank')
@@ -189,4 +196,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_image']
+ complete_apps = ['cmsplugin_filer_image']
@@ -2,21 +2,27 @@
import datetime
from south.db import db
from south.v2 import SchemaMigration
-from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
class Migration(SchemaMigration):
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerimage', 'cmsplugin_filer_image_filerimage'),
+ )
def forwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerImage.style'
- db.add_column(u'cmsplugin_filer_image_filerimage', 'style',
+ db.add_column(u'cmsplugin_filerimage', 'style',
self.gf('django.db.models.fields.CharField')(default='default', max_length=50),
keep_default=False)
def backwards(self, orm):
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerImage.style'
- db.delete_column(u'cmsplugin_filer_image_filerimage', 'style')
+ db.delete_column(u'cmsplugin_filerimage', 'style')
models = {
@@ -193,4 +199,4 @@ def backwards(self, orm):
}
}
- complete_apps = ['cmsplugin_filer_image']
+ complete_apps = ['cmsplugin_filer_image']
@@ -2,18 +2,25 @@
from south.db import db
from django.db import models
from cmsplugin_filer_teaser.models import *
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
+
class Migration:
+
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerteaser', 'cmsplugin_filer_teaser_filerteaser'),
+ )
def forwards(self, orm):
-
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerTeaser.style'
db.add_column('cmsplugin_filerteaser', 'style', orm['cmsplugin_filer_teaser.filerteaser:style'])
def backwards(self, orm):
-
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerTeaser.style'
db.delete_column('cmsplugin_filerteaser', 'style')
@@ -3,17 +3,24 @@
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
+from cmsplugin_filer_utils.migration import rename_tables_new_to_old
+
class Migration(SchemaMigration):
+
+ cms_plugin_table_mapping = (
+ # (old_name, new_name),
+ ('cmsplugin_filerteaser', 'cmsplugin_filer_teaser_filerteaser'),
+ )
def forwards(self, orm):
-
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Adding field 'FilerTeaser.target_blank'
db.add_column('cmsplugin_filerteaser', 'target_blank', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep_default=False)
def backwards(self, orm):
-
+ rename_tables_new_to_old(db, self.cms_plugin_table_mapping)
# Deleting field 'FilerTeaser.target_blank'
db.delete_column('cmsplugin_filerteaser', 'target_blank')
Oops, something went wrong.

0 comments on commit 9185818

Please sign in to comment.