Permalink
Browse files

adds smart cms3 plugin migrations for file

  • Loading branch information...
1 parent 1f50b26 commit 3c99b6872cbfe4ff0053ca2b6a565e9a59b546aa @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,18 +3,26 @@
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_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_filerfile', 'style')

0 comments on commit 3c99b68

Please sign in to comment.